Class FluidTankTileEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
All Implemented Interfaces:
IHaveGoggleInformation, ISpecialBlockEntityItemRequirement, IMultiTileContainer, IMultiTileContainer.Fluid, IInteractionChecker, IPartialSafeNBT, 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>
Direct Known Subclasses:
CreativeFluidTankTileEntity

public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleInformation, IMultiTileContainer.Fluid
  • Field Details

    • fluidCapability

      protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler> fluidCapability
    • forceFluidLevelUpdate

      protected boolean forceFluidLevelUpdate
    • tankInventory

      protected net.minecraftforge.fluids.capability.templates.FluidTank tankInventory
    • controller

      protected net.minecraft.core.BlockPos controller
    • lastKnownPos

      protected net.minecraft.core.BlockPos lastKnownPos
    • updateConnectivity

      protected boolean updateConnectivity
    • window

      protected boolean window
    • luminosity

      protected int luminosity
    • width

      protected int width
    • height

      protected int height
    • boiler

      public BoilerData boiler
    • syncCooldown

      protected int syncCooldown
    • queuedSync

      protected boolean queuedSync
  • Constructor Details

    • FluidTankTileEntity

      public FluidTankTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • createInventory

      protected SmartFluidTank createInventory()
    • updateConnectivity

      protected void updateConnectivity()
    • tick

      public void tick()
      Overrides:
      tick in class SmartTileEntity
    • getLastKnownPos

      public net.minecraft.core.BlockPos getLastKnownPos()
      Specified by:
      getLastKnownPos in interface IMultiTileContainer
    • isController

      public boolean isController()
      Specified by:
      isController in interface IMultiTileContainer
    • initialize

      public void initialize()
      Overrides:
      initialize in class SmartTileEntity
    • onFluidStackChanged

      protected void onFluidStackChanged(net.minecraftforge.fluids.FluidStack newFluidStack)
    • setLuminosity

      protected void setLuminosity(int luminosity)
    • getControllerTE

      public FluidTankTileEntity getControllerTE()
      Specified by:
      getControllerTE in interface IMultiTileContainer
    • applyFluidTankSize

      public void applyFluidTankSize(int blocks)
    • removeController

      public void removeController(boolean keepFluids)
      Specified by:
      removeController in interface IMultiTileContainer
    • toggleWindows

      public void toggleWindows()
    • updateBoilerTemperature

      public void updateBoilerTemperature()
    • sendDataImmediately

      public void sendDataImmediately()
    • sendData

      public void sendData()
      Overrides:
      sendData in class SyncedTileEntity
    • setWindows

      public void setWindows(boolean window)
    • updateBoilerState

      public void updateBoilerState()
    • setController

      public void setController(net.minecraft.core.BlockPos controller)
      Specified by:
      setController in interface IMultiTileContainer
    • getController

      public net.minecraft.core.BlockPos getController()
      Specified by:
      getController in interface IMultiTileContainer
    • createRenderBoundingBox

      protected net.minecraft.world.phys.AABB createRenderBoundingBox()
      Overrides:
      createRenderBoundingBox in class CachedRenderBBTileEntity
    • getOtherFluidTankTileEntity

      @Nullable public FluidTankTileEntity getOtherFluidTankTileEntity(net.minecraft.core.Direction direction)
    • addToGoggleTooltip

      public boolean addToGoggleTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking)
      Description copied from interface: IHaveGoggleInformation
      this method will be called when looking at a TileEntity that implemented this interface
      Specified by:
      addToGoggleTooltip in interface IHaveGoggleInformation
      Returns:
      true if the tooltip creation was successful and should be displayed, or false if the overlay should not be displayed
    • read

      protected void read(net.minecraft.nbt.CompoundTag compound, boolean clientPacket)
      Description copied from class: SmartTileEntity
      Hook only these in future subclasses of STE
      Overrides:
      read in class SmartTileEntity
    • getFillState

      public float getFillState()
    • write

      public void write(net.minecraft.nbt.CompoundTag compound, boolean clientPacket)
      Description copied from class: SmartTileEntity
      Hook only these in future subclasses of STE
      Overrides:
      write in class SmartTileEntity
    • getCapability

      @Nonnull public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(@Nonnull net.minecraftforge.common.capabilities.Capability<T> cap, @Nullable net.minecraft.core.Direction side)
      Specified by:
      getCapability in interface net.minecraftforge.common.capabilities.ICapabilityProvider
      Overrides:
      getCapability in class net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
    • setRemoved

      public void setRemoved()
      Overrides:
      setRemoved in class SmartTileEntity
    • addBehaviours

      public void addBehaviours(List<TileEntityBehaviour> behaviours)
      Specified by:
      addBehaviours in class SmartTileEntity
    • getTankInventory

      public net.minecraftforge.fluids.IFluidTank getTankInventory()
    • getTotalTankSize

      public int getTotalTankSize()
    • getMaxSize

      public static int getMaxSize()
    • getCapacityMultiplier

      public static int getCapacityMultiplier()
    • getMaxHeight

      public static int getMaxHeight()
    • getFluidLevel

      public LerpedFloat getFluidLevel()
    • setFluidLevel

      public void setFluidLevel(LerpedFloat fluidLevel)
    • preventConnectivityUpdate

      public void preventConnectivityUpdate()
      Specified by:
      preventConnectivityUpdate in interface IMultiTileContainer
    • notifyMultiUpdated

      public void notifyMultiUpdated()
      Specified by:
      notifyMultiUpdated in interface IMultiTileContainer
    • setExtraData

      public void setExtraData(@Nullable Object data)
      Specified by:
      setExtraData in interface IMultiTileContainer
    • getExtraData

      @Nullable public Object getExtraData()
      Specified by:
      getExtraData in interface IMultiTileContainer
    • modifyExtraData

      public Object modifyExtraData(Object data)
      Specified by:
      modifyExtraData in interface IMultiTileContainer
    • getMainConnectionAxis

      public net.minecraft.core.Direction.Axis getMainConnectionAxis()
      Specified by:
      getMainConnectionAxis in interface IMultiTileContainer
    • getMaxLength

      public int getMaxLength(net.minecraft.core.Direction.Axis longAxis, int width)
      Specified by:
      getMaxLength in interface IMultiTileContainer
    • getMaxWidth

      public int getMaxWidth()
      Specified by:
      getMaxWidth in interface IMultiTileContainer
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface IMultiTileContainer
    • setHeight

      public void setHeight(int height)
      Specified by:
      setHeight in interface IMultiTileContainer
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface IMultiTileContainer
    • setWidth

      public void setWidth(int width)
      Specified by:
      setWidth in interface IMultiTileContainer
    • hasTank

      public boolean hasTank()
      Specified by:
      hasTank in interface IMultiTileContainer.Fluid
    • getTankSize

      public int getTankSize(int tank)
      Specified by:
      getTankSize in interface IMultiTileContainer.Fluid
    • setTankSize

      public void setTankSize(int tank, int blocks)
      Specified by:
      setTankSize in interface IMultiTileContainer.Fluid
    • getTank

      public net.minecraftforge.fluids.IFluidTank getTank(int tank)
      Specified by:
      getTank in interface IMultiTileContainer.Fluid
    • getFluid

      public net.minecraftforge.fluids.FluidStack getFluid(int tank)
      Specified by:
      getFluid in interface IMultiTileContainer.Fluid