Class NetworkElementBase
java.lang.Object
org.cyclops.integrateddynamics.core.network.NetworkElementBase
- All Implemented Interfaces:
 Comparable<INetworkElement>,INetworkElement
- Direct Known Subclasses:
 CoalGeneratorNetworkElement,ConsumingNetworkElementBase,EnergyBatteryNetworkElement,MechanicalMachineNetworkElement,PartNetworkElement
Base implementation for a network element.
- 
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.voidafterNetworkReAlive(INetwork network) Called right after this network has come alive again, for example after a network restart.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.protected booleancanRevalidatePositioned(INetwork network, org.cyclops.cyclopscore.datastructure.DimPos dimPos) intvoidinvalidate(INetwork network) Invalidate this network element.booleanisUpdate()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.voidonPostRemoved(INetwork network) Called when this element has been removed.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 voidrevalidatePositioned(INetwork network, org.cyclops.cyclopscore.datastructure.DimPos dimPos) voidUpdate at the tick interval specified.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.cyclops.integrateddynamics.api.network.INetworkElement
canRevalidate, getChannel, getPriority, onNeighborBlockChange, setPriorityAndChannel 
- 
Constructor Details
- 
NetworkElementBase
public NetworkElementBase() 
 - 
 - 
Method Details
- 
getUpdateInterval
public int getUpdateInterval()- Specified by:
 getUpdateIntervalin interfaceINetworkElement- Returns:
 - The tick interval to update this element.
 
 - 
isUpdate
public boolean isUpdate()- Specified by:
 isUpdatein interfaceINetworkElement- 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- 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- 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- Parameters:
 network- The network to update in.
 - 
afterNetworkReAlive
Description copied from interface:INetworkElementCalled right after this network has come alive again, for example after a network restart.- Specified by:
 afterNetworkReAlivein interfaceINetworkElement- 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- 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- 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- Parameters:
 network- The network.blockState- The block state.blockEntity- The block entity.
 - 
onPreRemoved
Description copied from interface:INetworkElementCalled when this element is about to be removed. This is called beforeIFullNetworkListener.removeNetworkElementPre(INetworkElement).- Specified by:
 onPreRemovedin interfaceINetworkElement- Parameters:
 network- The network.
 - 
onPostRemoved
Description copied from interface:INetworkElementCalled when this element has been removed. This is called afterIFullNetworkListener.removeNetworkElementPost(INetworkElement, BlockState, BlockEntity).- Specified by:
 onPostRemovedin interfaceINetworkElement- 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- Parameters:
 network- The network to update in.world- The world in which the neighbour was updated.
 - 
invalidate
Description copied from interface:INetworkElementInvalidate this network element.- Specified by:
 invalidatein interfaceINetworkElement- Parameters:
 network- The network.
 - 
revalidate
Description copied from interface:INetworkElementRevalidate this network element after it has been invalidated.- Specified by:
 revalidatein interfaceINetworkElement- Parameters:
 network- The network.
 - 
canRevalidatePositioned
protected boolean canRevalidatePositioned(INetwork network, org.cyclops.cyclopscore.datastructure.DimPos dimPos)  - 
revalidatePositioned
protected void revalidatePositioned(INetwork network, org.cyclops.cyclopscore.datastructure.DimPos dimPos)  
 -