Class EnergyBatteryNetworkElement
java.lang.Object
org.cyclops.integrateddynamics.core.network.NetworkElementBase
org.cyclops.integrateddynamics.network.EnergyBatteryNetworkElement
- All Implemented Interfaces:
 Comparable<INetworkElement>,INetworkElement
Network element for variable stores.
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddDrops(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.block.entity.BlockEntity blockEntity, List<net.minecraft.world.item.ItemStack> itemStacks, boolean dropMainElement, boolean saveState) Add the itemstacks to drop when this element is removed.voidafterNetworkAlive(INetwork network) Called right after this network is initialized.voidbeforeNetworkKill(INetwork network, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.block.entity.BlockEntity blockEntity) Called right before the network is terminated or will be reset.booleancanRevalidate(INetwork network) Check if this element can be revalidated if it has been invalidated.intintintintbooleanisUpdate()voidonNeighborBlockChange(INetwork network, net.minecraft.world.level.BlockGetter world) Called when a neighbouring block is updated, more specifically whenBlockBehaviour.neighborChanged(BlockState, Level, BlockPos, Block, Orientation, boolean),IBlockExtension.onNeighborChange(BlockState, LevelReader, BlockPos, BlockPos)orBlockBehaviour.updateShape(BlockState, LevelReader, ScheduledTickAccess, BlockPos, Direction, BlockPos, BlockState, RandomSource)is called.booleanonNetworkAddition(INetwork network) Called when this element is added to the network.voidonNetworkRemoval(INetwork network, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.block.entity.BlockEntity blockEntity) Called when this element is removed from the network.voidonPreRemoved(INetwork network) Called when this element is about to be removed.voidrevalidate(INetwork network) Revalidate this network element after it has been invalidated.protected voidscheduleNetworkObservation(INetwork network, PartPos pos) voidsetPriorityAndChannel(INetwork network, int priority, int channel) Set the priority and channel of this element in the network.voidUpdate at the tick interval specified.Methods inherited from class org.cyclops.integrateddynamics.core.network.NetworkElementBase
afterNetworkReAlive, canRevalidatePositioned, invalidate, onPostRemoved, revalidatePositionedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.network.INetworkElement
onNeighborBlockChange 
- 
Constructor Details
- 
EnergyBatteryNetworkElement
public EnergyBatteryNetworkElement() 
 - 
 - 
Method Details
- 
getUpdateInterval
public int getUpdateInterval()- Specified by:
 getUpdateIntervalin interfaceINetworkElement- Overrides:
 getUpdateIntervalin classNetworkElementBase- Returns:
 - The tick interval to update this element.
 
 - 
isUpdate
public boolean isUpdate()- Specified by:
 isUpdatein interfaceINetworkElement- Overrides:
 isUpdatein classNetworkElementBase- Returns:
 - If this element should be updated. This method is only called once during network initialization.
 
 - 
update
Description copied from interface:INetworkElementUpdate at the tick interval specified.- Specified by:
 updatein interfaceINetworkElement- Overrides:
 updatein classNetworkElementBase- Parameters:
 network- The network to update in.
 - 
beforeNetworkKill
public void beforeNetworkKill(INetwork network, @Nullable net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity) Description copied from interface:INetworkElementCalled right before the network is terminated or will be reset.- Specified by:
 beforeNetworkKillin interfaceINetworkElement- Overrides:
 beforeNetworkKillin classNetworkElementBase- Parameters:
 network- The network to update in.blockState- The block state.blockEntity- The block entity.
 - 
afterNetworkAlive
Description copied from interface:INetworkElementCalled right after this network is initialized.- Specified by:
 afterNetworkAlivein interfaceINetworkElement- Overrides:
 afterNetworkAlivein classNetworkElementBase- Parameters:
 network- The network to update in.
 - 
addDrops
public void addDrops(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.block.entity.BlockEntity blockEntity, List<net.minecraft.world.item.ItemStack> itemStacks, boolean dropMainElement, boolean saveState) Description copied from interface:INetworkElementAdd the itemstacks to drop when this element is removed.- Specified by:
 addDropsin interfaceINetworkElement- Overrides:
 addDropsin classNetworkElementBase- Parameters:
 blockState- The block state of the container block.blockEntity- The block entity of the container block.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
Description copied from interface:INetworkElementCalled when this element is added to the network.- Specified by:
 onNetworkAdditionin interfaceINetworkElement- Overrides:
 onNetworkAdditionin classNetworkElementBase- Parameters:
 network- The network.- Returns:
 - If the addition succeeded.
 
 - 
onNetworkRemoval
public void onNetworkRemoval(INetwork network, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.block.entity.BlockEntity blockEntity) Description copied from interface:INetworkElementCalled when this element is removed from the network.- Specified by:
 onNetworkRemovalin interfaceINetworkElement- Overrides:
 onNetworkRemovalin classNetworkElementBase- Parameters:
 network- The network.blockState- The block state.blockEntity- The block entity.
 - 
scheduleNetworkObservation
 - 
onPreRemoved
Description copied from interface:INetworkElementCalled when this element is about to be removed. This is called beforeIFullNetworkListener.removeNetworkElementPre(INetworkElement).- Specified by:
 onPreRemovedin interfaceINetworkElement- Overrides:
 onPreRemovedin classNetworkElementBase- Parameters:
 network- The network.
 - 
onNeighborBlockChange
public void onNeighborBlockChange(@Nullable INetwork network, net.minecraft.world.level.BlockGetter world) Description copied from interface:INetworkElementCalled when a neighbouring block is updated, more specifically whenBlockBehaviour.neighborChanged(BlockState, Level, BlockPos, Block, Orientation, boolean),IBlockExtension.onNeighborChange(BlockState, LevelReader, BlockPos, BlockPos)orBlockBehaviour.updateShape(BlockState, LevelReader, ScheduledTickAccess, BlockPos, Direction, BlockPos, BlockState, RandomSource)is called.- Specified by:
 onNeighborBlockChangein interfaceINetworkElement- Overrides:
 onNeighborBlockChangein classNetworkElementBase- Parameters:
 network- The network to update in.world- The world in which the neighbour was updated.
 - 
setPriorityAndChannel
Description copied from interface:INetworkElementSet the priority and channel of this element in the network.- Parameters:
 network- The network this element is present in.priority- The new prioritychannel- 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
Description copied from interface:INetworkElementCheck if this element can be revalidated if it has been invalidated.- Parameters:
 network- The network.- Returns:
 - If it can be revalidated.
 
 - 
revalidate
Description copied from interface:INetworkElementRevalidate this network element after it has been invalidated.- Specified by:
 revalidatein interfaceINetworkElement- Overrides:
 revalidatein classNetworkElementBase- Parameters:
 network- The network.
 - 
compareTo
 
 -