Class EnergyBatteryNetworkElement

java.lang.Object
org.cyclops.integrateddynamics.core.network.NetworkElementBase
org.cyclops.integrateddynamics.network.EnergyBatteryNetworkElement
All Implemented Interfaces:
Comparable<INetworkElement>, INetworkElement

public class EnergyBatteryNetworkElement extends NetworkElementBase
Network element for variable stores.
  • Constructor Details

    • EnergyBatteryNetworkElement

      public EnergyBatteryNetworkElement()
  • Method Details

    • getTile

      protected Optional<BlockEntityEnergyBattery> getTile()
    • getUpdateInterval

      public int getUpdateInterval()
      Specified by:
      getUpdateInterval in interface INetworkElement
      Overrides:
      getUpdateInterval in class NetworkElementBase
      Returns:
      The tick interval to update this element.
    • isUpdate

      public boolean isUpdate()
      Specified by:
      isUpdate in interface INetworkElement
      Overrides:
      isUpdate in class NetworkElementBase
      Returns:
      If this element should be updated. This method is only called once during network initialization.
    • update

      public void update(INetwork network)
      Description copied from interface: INetworkElement
      Update at the tick interval specified.
      Specified by:
      update in interface INetworkElement
      Overrides:
      update in class NetworkElementBase
      Parameters:
      network - The network to update in.
    • beforeNetworkKill

      public void beforeNetworkKill(INetwork network)
      Description copied from interface: INetworkElement
      Called right before the network is terminated or will be reset.
      Specified by:
      beforeNetworkKill in interface INetworkElement
      Overrides:
      beforeNetworkKill in class NetworkElementBase
      Parameters:
      network - The network to update in.
    • afterNetworkAlive

      public void afterNetworkAlive(INetwork network)
      Description copied from interface: INetworkElement
      Called right after this network is initialized.
      Specified by:
      afterNetworkAlive in interface INetworkElement
      Overrides:
      afterNetworkAlive in class NetworkElementBase
      Parameters:
      network - The network to update in.
    • addDrops

      public void addDrops(List<net.minecraft.world.item.ItemStack> itemStacks, boolean dropMainElement, boolean saveState)
      Description copied from interface: INetworkElement
      Add the itemstacks to drop when this element is removed.
      Specified by:
      addDrops in interface INetworkElement
      Overrides:
      addDrops in class NetworkElementBase
      Parameters:
      itemStacks - The itemstack list to add to.
      dropMainElement - If the part itself should also be dropped.
      saveState - If the element state should be saved in the item.
    • onNetworkAddition

      public boolean onNetworkAddition(INetwork network)
      Description copied from interface: INetworkElement
      Called when this element is added to the network.
      Specified by:
      onNetworkAddition in interface INetworkElement
      Overrides:
      onNetworkAddition in class NetworkElementBase
      Parameters:
      network - The network.
      Returns:
      If the addition succeeded.
    • onNetworkRemoval

      public void onNetworkRemoval(INetwork network)
      Description copied from interface: INetworkElement
      Called when this element is removed from the network.
      Specified by:
      onNetworkRemoval in interface INetworkElement
      Overrides:
      onNetworkRemoval in class NetworkElementBase
      Parameters:
      network - The network.
    • scheduleNetworkObservation

      protected void scheduleNetworkObservation(INetwork network, PartPos pos)
    • onPreRemoved

      public void onPreRemoved(INetwork network)
      Description copied from interface: INetworkElement
      Called when this element is about to be removed. This is called before IFullNetworkListener.removeNetworkElementPre(INetworkElement).
      Specified by:
      onPreRemoved in interface INetworkElement
      Overrides:
      onPreRemoved in class NetworkElementBase
      Parameters:
      network - The network.
    • onNeighborBlockChange

      public void onNeighborBlockChange(@Nullable INetwork network, net.minecraft.world.level.BlockGetter world, net.minecraft.world.level.block.Block neighbourBlock, net.minecraft.core.BlockPos neighbourBlockPos)
      Description copied from interface: INetworkElement
      Called when a neighbouring block is updated, more specifically when BlockBehaviour.neighborChanged(BlockState, Level, BlockPos, Block, BlockPos, boolean), IForgeBlock.onNeighborChange(BlockState, LevelReader, BlockPos, BlockPos) or BlockBehaviour.updateShape(BlockState, Direction, BlockState, LevelAccessor, BlockPos, BlockPos) is called.
      Specified by:
      onNeighborBlockChange in interface INetworkElement
      Overrides:
      onNeighborBlockChange in class NetworkElementBase
      Parameters:
      network - The network to update in.
      world - The world in which the neighbour was updated.
      neighbourBlock - block type of the neighbour that was updated.
      neighbourBlockPos - The position of the neighbour that was updated.
    • setPriorityAndChannel

      public void setPriorityAndChannel(INetwork network, int priority, int channel)
      Description copied from interface: INetworkElement
      Set the priority and channel of this element in the network.
      Parameters:
      network - The network this element is present in.
      priority - The new priority
      channel - The new channel
    • getPriority

      public int getPriority()
      Returns:
      The priority of this element in the network.
    • getChannel

      public int getChannel()
      Returns:
      The channel of this element in the network.
    • canRevalidate

      public boolean canRevalidate(INetwork network)
      Description copied from interface: INetworkElement
      Check if this element can be revalidated if it has been invalidated.
      Parameters:
      network - The network.
      Returns:
      If it can be revalidated.
    • revalidate

      public void revalidate(INetwork network)
      Description copied from interface: INetworkElement
      Revalidate this network element after it has been invalidated.
      Specified by:
      revalidate in interface INetworkElement
      Overrides:
      revalidate in class NetworkElementBase
      Parameters:
      network - The network.
    • compareTo

      public int compareTo(INetworkElement o)