Class PressureTubeBlockEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
All Implemented Interfaces:
IAirListener, IManoMeasurable, CamouflageableBlockEntity, IGUIButtonSensitive, ILuaMethodProvider, IDescSynced, IUpgradeHolder, net.minecraft.world.Nameable, 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:
AdvancedPressureTubeBlockEntity, ReinforcedPressureTubeBlockEntity

public class PressureTubeBlockEntity extends AbstractAirHandlingBlockEntity implements IAirListener, IManoMeasurable, CamouflageableBlockEntity
  • Constructor Details

    • PressureTubeBlockEntity

      public PressureTubeBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • load

      public void load(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      load in class AbstractAirHandlingBlockEntity
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag nbt)
      Overrides:
      saveAdditional in class AbstractAirHandlingBlockEntity
    • writeToPacket

      public void writeToPacket(net.minecraft.nbt.CompoundTag tag)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Encoded into the description packet. Also included in saved data written by BlockEntity.saveAdditional(CompoundTag) Prefer to use @DescSynced where possible - use this either for complex fields not handled by @DescSynced, or for non-ticking tile entities.
      Specified by:
      writeToPacket in interface IDescSynced
      Overrides:
      writeToPacket in class AbstractAirHandlingBlockEntity
      Parameters:
      tag - NBT tag
    • writeModulesToNBT

      public void writeModulesToNBT(net.minecraft.nbt.CompoundTag tag)
    • readFromPacket

      public void readFromPacket(net.minecraft.nbt.CompoundTag tag)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Encoded into the description packet. Also included in saved data read by AbstractPneumaticCraftBlockEntity.load(CompoundTag). Prefer to use @DescSynced where possible - use this either for complex fields not handled by @DescSynced, or for non-ticking tile entities.
      Specified by:
      readFromPacket in interface IDescSynced
      Overrides:
      readFromPacket in class AbstractAirHandlingBlockEntity
      Parameters:
      tag - NBT tag
    • updateRenderBoundingBox

      public void updateRenderBoundingBox()
    • tickCommonPre

      public void tickCommonPre()
      Description copied from class: AbstractTickingBlockEntity
      Called on both server and client, before anything else
      Overrides:
      tickCommonPre in class AbstractAirHandlingBlockEntity
    • tickClient

      public void tickClient()
      Overrides:
      tickClient in class AbstractTickingBlockEntity
    • tickServer

      public void tickServer()
      Overrides:
      tickServer in class AbstractTickingBlockEntity
    • onLoad

      public void onLoad()
      Specified by:
      onLoad in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      onLoad in class AbstractAirHandlingBlockEntity
    • onAirDispersion

      public void onAirDispersion(IAirHandlerMachine handler, @Nullable net.minecraft.core.Direction side, int airDispersed)
      Description copied from interface: IAirListener
      Called when air is added to, or removed from a handler, dispersed into/from a certain direction. Used by the Flow Detector Module, for example.
      Specified by:
      onAirDispersion in interface IAirListener
      Parameters:
      handler - the air handler in question
      side - the direction of air dispersal
      airDispersed - the amount of air dispersed to the neighbouring handler (negative when air is being added to this handler)
    • getMaxDispersion

      public int getMaxDispersion(IAirHandlerMachine handler, @Nullable net.minecraft.core.Direction side)
      Description copied from interface: IAirListener
      Method fired to get the maximum amount of air allowed to disperse to the given direction. Used in the Regulator Tube Module, for example, to limit air flow.
      Specified by:
      getMaxDispersion in interface IAirListener
      Parameters:
      handler - the air handler in question
      side - the direction of dispersal
      Returns:
      the max amount of air which may be dispersed this tick (return Integer.MAX_VALUE to have no limit)
    • getModule

      public AbstractTubeModule getModule(net.minecraft.core.Direction side)
    • isSideClosed

      public boolean isSideClosed(net.minecraft.core.Direction side)
    • setSideClosed

      public void setSideClosed(net.minecraft.core.Direction side, boolean closed)
    • tubeModules

      public Stream<AbstractTubeModule> tubeModules()
    • mayPlaceModule

      public boolean mayPlaceModule(AbstractTubeModule module)
    • setModule

      public void setModule(net.minecraft.core.Direction side, AbstractTubeModule module)
    • canConnectPneumatic

      public boolean canConnectPneumatic(net.minecraft.core.Direction side)
      Description copied from class: AbstractAirHandlingBlockEntity
      Checks if the given side of this BE can be pneumatically connected to.
      Overrides:
      canConnectPneumatic in class AbstractAirHandlingBlockEntity
      Parameters:
      side - the side to check
      Returns:
      true if connected, false otherwise
    • onNeighborTileUpdate

      public void onNeighborTileUpdate(net.minecraft.core.BlockPos tilePos)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Called when a neighboring block entity changes state (specifically when Level.updateNeighbourForOutputSignal(BlockPos, Block) is called.
      Overrides:
      onNeighborTileUpdate in class AbstractPneumaticCraftBlockEntity
      Parameters:
      tilePos - the blockpos of the neighboring block entity
    • onNeighborBlockUpdate

      public void onNeighborBlockUpdate(net.minecraft.core.BlockPos fromPos)
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Called when a neighboring block changes state (i.e. blockstate update)
      Overrides:
      onNeighborBlockUpdate in class AbstractAirHandlingBlockEntity
      Parameters:
      fromPos - the blockpos of the block that caused this update
    • getPrimaryInventory

      public net.minecraftforge.items.IItemHandler getPrimaryInventory()
      Specified by:
      getPrimaryInventory in class AbstractPneumaticCraftBlockEntity
    • getConnectedNeighbor

      public net.minecraft.world.level.block.entity.BlockEntity getConnectedNeighbor(net.minecraft.core.Direction dir)
    • getRenderBoundingBox

      public net.minecraft.world.phys.AABB getRenderBoundingBox()
      Specified by:
      getRenderBoundingBox in interface net.minecraftforge.common.extensions.IForgeBlockEntity
    • printManometerMessage

      public void printManometerMessage(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> text)
      Description copied from interface: IManoMeasurable
      This method is invoked by the Manometer when a player right-clicks a BE or Entity with this interface implemented.
      Specified by:
      printManometerMessage in interface IManoMeasurable
      Parameters:
      player - player who is right-clicking the measurable BE, and therefore needs to get the message
      text - list you can append info to. If you don't append any info no air will be used.
    • getCamouflage

      public net.minecraft.world.level.block.state.BlockState getCamouflage()
      Description copied from interface: CamouflageableBlockEntity
      Get the camouflage state; the blockstate which will be used to render this block entity's block.
      Specified by:
      getCamouflage in interface CamouflageableBlockEntity
      Returns:
      the camouflage state, or null if the block should not be camouflaged
    • setCamouflage

      public void setCamouflage(net.minecraft.world.level.block.state.BlockState state)
      Description copied from interface: CamouflageableBlockEntity
      Set the camouflage for the block entity. The block entity should sync this state to the client, and do any necessary re-rendering of the block when the synced state changes.
      Specified by:
      setCamouflage in interface CamouflageableBlockEntity
      Parameters:
      state - the camo block state
    • getCachedTubeShape

      public net.minecraft.world.phys.shapes.VoxelShape getCachedTubeShape(net.minecraft.world.phys.shapes.VoxelShape blockShape)
    • clearCachedShape

      public void clearCachedShape()