Class AbstractAirHandlingBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
me.desht.pneumaticcraft.common.block.entity.AbstractAirHandlingBlockEntity
- 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,PneumaticDoorBaseBlockEntity,PneumaticDynamoBlockEntity,PressureChamberValveBlockEntity,PressureTubeBlockEntity,PressurizedSpawnerBlockEntity,ProgrammableControllerBlockEntity,SolarCompressorBlockEntity,SpawnerExtractorBlockEntity,ThermalCompressorBlockEntity,ThermopneumaticProcessingPlantBlockEntity,TubeJunctionBlockEntity,UniversalSensorBlockEntity,UVLightBoxBlockEntity,VacuumPumpBlockEntity,VacuumTrapBlockEntity,VortexTubeBlockEntity
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
AbstractPneumaticCraftBlockEntity.UpgradeHandlerNested 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 net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAirHandlingBlockEntity(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 Summary
Modifier and TypeMethodDescriptionvoidaddAir(int air) voidaddLuaMethods(LuaMethodRegistry registry) Called lazily to populate the method registry with the methods.booleancanConnectPneumatic(net.minecraft.core.Direction side) Checks if the given side of this BE can be pneumatically connected to.<T> net.minecraftforge.common.util.LazyOptional<T>getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, net.minecraft.core.Direction side) floatfloatintfloatvoidhandleUpdateTag(net.minecraft.nbt.CompoundTag tag) booleanvoidinitializeHullAirHandlerClient(net.minecraft.core.Direction dir, IAirHandlerMachine handler) voidvoidload(net.minecraft.nbt.CompoundTag tag) voidvoidonLoad()voidonNeighborBlockUpdate(net.minecraft.core.BlockPos fromPos) Called when a neighboring block changes state (i.e.voidCalled when a machine's upgrades have changed in any way.voidreadFromPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) voidvoidCalled on both server and client, before anything elsevoidwriteToPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.Methods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
tickClient, tickCommonPost, tickServerMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
countPlayersUsing, getCachedNeighbor, getContentsToDrop, getCurrentRecipeIdSynced, getCustomName, getDescriptionFields, getDisplayName, getHeatCap, getInventoryCap, getLuaMethodRegistry, getModelData, getName, getPeripheralType, getPosition, getPrimaryInventory, getRotation, getSpeedMultiplierFromUpgrades, getSpeedUsageMultiplierFromUpgrades, getUpdateTag, getUpgradeCache, getUpgradeHandler, getUpgrades, handleGUIButtonPress, isGuiUseableByPlayer, nonNullLevel, onDescUpdate, onGuiUpdate, onNeighborTileUpdate, requestModelDataUpdate, sendDescriptionPacket, serializeExtraItemData, setChanged, setCustomName, setPreserveStateOnBreak, shouldPreserveStateOnBreak, shouldRerenderChunkOnDescUpdate, shouldSyncField, updateNeighboursMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getTileData, getType, getUpdatePacket, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setLevel, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getRenderBoundingBox, onDataPacket, serializeNBTMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
airHandler
-
-
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
-
handleUpdateTag
public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag) - Specified by:
handleUpdateTagin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
handleUpdateTagin classAbstractPneumaticCraftBlockEntity
-
onLoad
public void onLoad()- Specified by:
onLoadin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
onLoadin classAbstractPneumaticCraftBlockEntity
-
tickCommonPre
public void tickCommonPre()Description copied from class:AbstractTickingBlockEntityCalled on both server and client, before anything else- Overrides:
tickCommonPrein classAbstractTickingBlockEntity
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin classAbstractPneumaticCraftBlockEntity
-
onUpgradesChanged
public void onUpgradesChanged()Description copied from class:AbstractPneumaticCraftBlockEntityCalled 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:
onUpgradesChangedin interfaceIUpgradeHolder- Overrides:
onUpgradesChangedin classAbstractPneumaticCraftBlockEntity
-
onBlockRotated
public void onBlockRotated()- Overrides:
onBlockRotatedin classAbstractPneumaticCraftBlockEntity
-
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:
getCapabilityin interfacenet.minecraftforge.common.capabilities.ICapabilityProvider- Overrides:
getCapabilityin classAbstractPneumaticCraftBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classAbstractPneumaticCraftBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classAbstractPneumaticCraftBlockEntity
-
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:AbstractPneumaticCraftBlockEntityCalled when a neighboring block changes state (i.e. blockstate update)- Overrides:
onNeighborBlockUpdatein classAbstractPneumaticCraftBlockEntity- Parameters:
fromPos- the blockpos of the block that caused this update
-
writeToPacket
public void writeToPacket(net.minecraft.nbt.CompoundTag tag) Description copied from class:AbstractPneumaticCraftBlockEntityEncoded into the description packet. Also included in saved data written byBlockEntity.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:
writeToPacketin interfaceIDescSynced- Overrides:
writeToPacketin classAbstractPneumaticCraftBlockEntity- Parameters:
tag- NBT tag
-
readFromPacket
public void readFromPacket(net.minecraft.nbt.CompoundTag tag) Description copied from class:AbstractPneumaticCraftBlockEntityEncoded into the description packet. Also included in saved data read byAbstractPneumaticCraftBlockEntity.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:
readFromPacketin interfaceIDescSynced- Overrides:
readFromPacketin classAbstractPneumaticCraftBlockEntity- Parameters:
tag- NBT tag
-
addLuaMethods
Description copied from interface:ILuaMethodProviderCalled lazily to populate the method registry with the methods.- Specified by:
addLuaMethodsin interfaceILuaMethodProvider- Overrides:
addLuaMethodsin classAbstractPneumaticCraftBlockEntity- 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()
-