Class AbstractAirHandlingBlockEntity

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:
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:
AerialInterfaceBlockEntity, AirCannonBlockEntity, AirCompressorBlockEntity, AssemblyControllerBlockEntity, ChargingStationBlockEntity, CreativeCompressorBlockEntity, ElectrostaticCompressorBlockEntity, ElevatorBaseBlockEntity, FluidMixerBlockEntity, FluxCompressorBlockEntity, GasLiftBlockEntity, LiquidCompressorBlockEntity, ManualCompressorBlockEntity, PneumaticDoorBaseBlockEntity, PneumaticDynamoBlockEntity, PressureChamberValveBlockEntity, PressureTubeBlockEntity, PressurizedSpawnerBlockEntity, ProgrammableControllerBlockEntity, SolarCompressorBlockEntity, SpawnerExtractorBlockEntity, ThermalCompressorBlockEntity, ThermopneumaticProcessingPlantBlockEntity, TubeJunctionBlockEntity, UniversalSensorBlockEntity, UVLightBoxBlockEntity, VacuumPumpBlockEntity, VacuumTrapBlockEntity, VortexTubeBlockEntity

public abstract class AbstractAirHandlingBlockEntity extends AbstractTickingBlockEntity
Base class for all PNC tile entities which handle air. Provides one default air handler; machines with multiple air handlers can add extra handlers in their subclass.
  • Field Details

  • Constructor Details

    • AbstractAirHandlingBlockEntity

      public AbstractAirHandlingBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, PressureTier pressureTier, int volume, int upgradeSlots)
  • Method Details

    • invalidateCaps

      public void invalidateCaps()
      Specified by:
      invalidateCaps in interface net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>
      Overrides:
      invalidateCaps in class net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
    • reviveCaps

      public void reviveCaps()
      Specified by:
      reviveCaps in interface net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>
      Overrides:
      reviveCaps in class net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
    • handleUpdateTag

      public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      handleUpdateTag in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      handleUpdateTag in class AbstractPneumaticCraftBlockEntity
    • onLoad

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

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

      public void setRemoved()
      Overrides:
      setRemoved in class AbstractPneumaticCraftBlockEntity
    • onUpgradesChanged

      public void onUpgradesChanged()
      Description copied from class: AbstractPneumaticCraftBlockEntity
      Called when a machine's upgrades have changed in any way. This is also called from readNBT() when saved upgrades are deserialized, so it is not guaranteed that the world field is non-null - beware. If you override this, remember to call the super method!
      Specified by:
      onUpgradesChanged in interface IUpgradeHolder
      Overrides:
      onUpgradesChanged in class AbstractPneumaticCraftBlockEntity
    • onBlockRotated

      public void onBlockRotated()
      Overrides:
      onBlockRotated in class AbstractPneumaticCraftBlockEntity
    • 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 AbstractPneumaticCraftBlockEntity
    • saveAdditional

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

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

      public void initializeHullAirHandlers()
    • initializeHullAirHandlerClient

      public void initializeHullAirHandlerClient(net.minecraft.core.Direction dir, IAirHandlerMachine handler)
    • 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 AbstractPneumaticCraftBlockEntity
      Parameters:
      fromPos - the blockpos of the block that caused this update
    • 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 AbstractPneumaticCraftBlockEntity
      Parameters:
      tag - NBT 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 AbstractPneumaticCraftBlockEntity
      Parameters:
      tag - NBT tag
    • addLuaMethods

      public void addLuaMethods(LuaMethodRegistry registry)
      Description copied from interface: ILuaMethodProvider
      Called lazily to populate the method registry with the methods.
      Specified by:
      addLuaMethods in interface ILuaMethodProvider
      Overrides:
      addLuaMethods in class AbstractPneumaticCraftBlockEntity
      Parameters:
      registry - the registry to populate
    • getPressure

      public float getPressure()
    • getDangerPressure

      public float getDangerPressure()
    • getCriticalPressure

      public float getCriticalPressure()
    • addAir

      public void addAir(int air)
    • canConnectPneumatic

      public boolean canConnectPneumatic(net.minecraft.core.Direction side)
      Checks if the given side of this BE can be pneumatically connected to.
      Parameters:
      side - the side to check
      Returns:
      true if connected, false otherwise
    • getDefaultVolume

      public int getDefaultVolume()
    • hasNoConnectedAirHandlers

      public boolean hasNoConnectedAirHandlers()