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 of BlockEntityTankInventory, 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 Classes

    Nested 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

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected int
     

    Fields inherited from class org.cyclops.evilcraft.core.blockentity.BlockEntityTankInventory

    tankSize

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    INFINITE_EXTENT_AABB
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    protected int
    Add a new ticker.
    int
    Get the current (numerical) state.
    abstract int
    Get the new (numerical) state for this tile entity.
    Get the tickers this TileEntity has.
    protected boolean
     
    abstract void
    What needs to happen when the (numerical) state is changed.
    void
    read(net.minecraft.nbt.CompoundTag data)
     
    void
    saveAdditional(net.minecraft.nbt.CompoundTag data)
     

    Methods 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, writeToItemStack

    Methods 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, triggerEvent

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.cyclops.cyclopscore.blockentity.IBlockEntityDelayedTickable

    reduceUpdateBackoff, sendImmediateUpdate

    Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability

    Methods 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

      protected int addTicker(TickComponent<T,ITickAction<T>> ticker)
      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

      public List<TickComponent<T,ITickAction<T>>> getTickers()
      Get the tickers this TileEntity has.
      Returns:
      List of added tickers.
    • read

      public void read(net.minecraft.nbt.CompoundTag data)
      Overrides:
      read in class BlockEntityTankInventory
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag data)
      Overrides:
      saveAdditional in class BlockEntityTankInventory
    • 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.