Class BlockEntityTickingTankInventory<T extends BlockEntityTankInventory>
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
org.cyclops.evilcraft.core.blockentity.BlockEntityTankInventory
org.cyclops.evilcraft.core.blockentity.BlockEntityTickingTankInventory<T>
- Type Parameters:
T- The subclass ofBlockEntityTankInventory, will be in most cases just the extension class.
- All Implemented Interfaces:
net.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>,net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>,net.minecraftforge.common.extensions.IForgeBlockEntity,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>,org.cyclops.cyclopscore.blockentity.IBlockEntityDelayedTickable,org.cyclops.cyclopscore.persist.IDirtyMarkListener,org.cyclops.cyclopscore.persist.nbt.INBTProvider
- Direct Known Subclasses:
BlockEntityBloodChest,BlockEntityWorking
public abstract class BlockEntityTickingTankInventory<T extends BlockEntityTankInventory>
extends BlockEntityTankInventory
A BlockEntity with Tank and Inventory that can tick.
It uses a list of
TickComponent that are able to tick.
And these components will contain a collection of ITickAction
that can perform specific actions depending on the condition of the TickComponent.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
FieldsFields inherited from class org.cyclops.evilcraft.core.blockentity.BlockEntityTankInventory
tankSizeFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsConstructorDescriptionBlockEntityTickingTankInventory(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState, int inventorySize, int stackSize, int tankSize, net.minecraft.world.level.material.Fluid acceptedFluid) -
Method Summary
Modifier and TypeMethodDescriptionprotected intaddTicker(TickComponent<T, ITickAction<T>> ticker) Add a new ticker.intGet the current (numerical) state.abstract intGet the new (numerical) state for this tile entity.Get the tickers this TileEntity has.protected booleanabstract voidWhat needs to happen when the (numerical) state is changed.voidread(net.minecraft.nbt.CompoundTag data) voidsaveAdditional(net.minecraft.nbt.CompoundTag data) Methods inherited from class org.cyclops.evilcraft.core.blockentity.BlockEntityTankInventory
addFluidHandlerCapabilities, addItemHandlerCapabilities, createInventory, createTank, getInventory, getTank, onTankChangedMethods inherited from class org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
addCapabilityInternal, addCapabilitySided, canInteractWith, getCapability, getRotation, getStoredCapabilities, getUpdateBackoff, getUpdateBackoffTicks, getUpdatePacket, getUpdateTag, invalidateCaps, load, onDataPacket, onDirty, onLoad, onUpdateReceived, readGeneratedFieldsFromNBT, sendUpdate, setUpdateBackoff, shouldSendUpdate, transformFacingForRotation, unsetSendUpdate, writeGeneratedFieldsToNBT, writeToItemStackMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.cyclopscore.blockentity.IBlockEntityDelayedTickable
reduceUpdateBackoff, sendImmediateUpdateMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, requestModelDataUpdate, serializeNBT
-
Field Details
-
currentState
protected int currentState -
previousState
protected int previousState
-
-
Constructor Details
-
BlockEntityTickingTankInventory
public BlockEntityTickingTankInventory(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState, int inventorySize, int stackSize, int tankSize, net.minecraft.world.level.material.Fluid acceptedFluid)
-
-
Method Details
-
addTicker
Add a new ticker.- Parameters:
ticker- The ticker to (try) run every tick.- Returns:
- The index of the newly added ticker in the ticker list.
-
getTickers
Get the tickers this TileEntity has.- Returns:
- List of added tickers.
-
read
public void read(net.minecraft.nbt.CompoundTag data) - Overrides:
readin classBlockEntityTankInventory
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag data) - Overrides:
saveAdditionalin classBlockEntityTankInventory
-
hasJustWorked
protected boolean hasJustWorked() -
getNewState
public abstract int getNewState()Get the new (numerical) state for this tile entity.- Returns:
- The new state.
-
onStateChanged
public abstract void onStateChanged()What needs to happen when the (numerical) state is changed. -
getCurrentState
public int getCurrentState()Get the current (numerical) state.- Returns:
- The current tile entity state.
-