Class PressureTubeBlockEntity
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
me.desht.pneumaticcraft.common.block.entity.PressureTubeBlockEntity
- 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
-
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
Fields inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractAirHandlingBlockEntity
airHandlerFields 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
ConstructorsConstructorDescriptionPressureTubeBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConnectPneumatic(net.minecraft.core.Direction side) Checks if the given side of this BE can be pneumatically connected to.voidnet.minecraft.world.phys.shapes.VoxelShapegetCachedTubeShape(net.minecraft.world.phys.shapes.VoxelShape blockShape) net.minecraft.world.level.block.state.BlockStateGet the camouflage state; the blockstate which will be used to render this block entity's block.net.minecraft.world.level.block.entity.BlockEntitygetConnectedNeighbor(net.minecraft.core.Direction dir) intgetMaxDispersion(IAirHandlerMachine handler, net.minecraft.core.Direction side) Method fired to get the maximum amount of air allowed to disperse to the given direction.getModule(net.minecraft.core.Direction side) net.minecraftforge.items.IItemHandlernet.minecraft.world.phys.AABBbooleanisSideClosed(net.minecraft.core.Direction side) voidload(net.minecraft.nbt.CompoundTag tag) booleanmayPlaceModule(AbstractTubeModule module) voidonAirDispersion(IAirHandlerMachine handler, net.minecraft.core.Direction side, int airDispersed) Called when air is added to, or removed from a handler, dispersed into/from a certain direction.voidonLoad()voidonNeighborBlockUpdate(net.minecraft.core.BlockPos fromPos) Called when a neighboring block changes state (i.e.voidonNeighborTileUpdate(net.minecraft.core.BlockPos tilePos) Called when a neighboring block entity changes state (specifically whenLevel.updateNeighbourForOutputSignal(BlockPos, Block)is called.voidprintManometerMessage(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> text) This method is invoked by the Manometer when a player right-clicks a BE or Entity with this interface implemented.voidreadFromPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.voidsaveAdditional(net.minecraft.nbt.CompoundTag nbt) voidsetCamouflage(net.minecraft.world.level.block.state.BlockState state) Set the camouflage for the block entity.voidsetModule(net.minecraft.core.Direction side, AbstractTubeModule module) voidsetSideClosed(net.minecraft.core.Direction side, boolean closed) voidvoidCalled on both server and client, before anything elsevoidvoidvoidwriteModulesToNBT(net.minecraft.nbt.CompoundTag tag) voidwriteToPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.Methods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractAirHandlingBlockEntity
addAir, addLuaMethods, getCapability, getCriticalPressure, getDangerPressure, getDefaultVolume, getPressure, handleUpdateTag, hasNoConnectedAirHandlers, initializeHullAirHandlerClient, initializeHullAirHandlers, invalidateCaps, onBlockRotated, onUpgradesChanged, reviveCaps, setRemovedMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
tickCommonPostMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
countPlayersUsing, getCachedNeighbor, getContentsToDrop, getCurrentRecipeIdSynced, getCustomName, getDescriptionFields, getDisplayName, getEnergyCap, getFluidCap, getHeatCap, getInventoryCap, getLuaMethodRegistry, getModelData, getName, getPeripheralType, getPosition, getRotation, getSpeedMultiplierFromUpgrades, getSpeedUsageMultiplierFromUpgrades, getUpdateTag, getUpgradeCache, getUpgradeHandler, getUpgrades, handleGUIButtonPress, isGuiUseableByPlayer, nonNullLevel, onDescUpdate, onGuiUpdate, 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, getPersistentData, getPosFromTag, 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, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.api.tileentity.IAirListener
addConnectedPneumaticsMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, hasCustomOutlineRendering, onDataPacket, serializeNBTMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
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:
loadin classAbstractAirHandlingBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag nbt) - Overrides:
saveAdditionalin classAbstractAirHandlingBlockEntity
-
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 classAbstractAirHandlingBlockEntity- 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: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 classAbstractAirHandlingBlockEntity- Parameters:
tag- NBT tag
-
updateRenderBoundingBox
public void updateRenderBoundingBox() -
tickCommonPre
public void tickCommonPre()Description copied from class:AbstractTickingBlockEntityCalled on both server and client, before anything else- Overrides:
tickCommonPrein classAbstractAirHandlingBlockEntity
-
tickClient
public void tickClient()- Overrides:
tickClientin classAbstractTickingBlockEntity
-
tickServer
public void tickServer()- Overrides:
tickServerin classAbstractTickingBlockEntity
-
onLoad
public void onLoad()- Specified by:
onLoadin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
onLoadin classAbstractAirHandlingBlockEntity
-
onAirDispersion
public void onAirDispersion(IAirHandlerMachine handler, @Nullable net.minecraft.core.Direction side, int airDispersed) Description copied from interface:IAirListenerCalled 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:
onAirDispersionin interfaceIAirListener- Parameters:
handler- the air handler in questionside- the direction of air dispersalairDispersed- 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:IAirListenerMethod 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:
getMaxDispersionin interfaceIAirListener- Parameters:
handler- the air handler in questionside- 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
-
isSideClosed
public boolean isSideClosed(net.minecraft.core.Direction side) -
setSideClosed
public void setSideClosed(net.minecraft.core.Direction side, boolean closed) -
tubeModules
-
mayPlaceModule
-
setModule
-
canConnectPneumatic
public boolean canConnectPneumatic(net.minecraft.core.Direction side) Description copied from class:AbstractAirHandlingBlockEntityChecks if the given side of this BE can be pneumatically connected to.- Overrides:
canConnectPneumaticin classAbstractAirHandlingBlockEntity- 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:AbstractPneumaticCraftBlockEntityCalled when a neighboring block entity changes state (specifically whenLevel.updateNeighbourForOutputSignal(BlockPos, Block)is called.- Overrides:
onNeighborTileUpdatein classAbstractPneumaticCraftBlockEntity- Parameters:
tilePos- the blockpos of the neighboring block entity
-
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 classAbstractAirHandlingBlockEntity- Parameters:
fromPos- the blockpos of the block that caused this update
-
getPrimaryInventory
public net.minecraftforge.items.IItemHandler getPrimaryInventory()- Specified by:
getPrimaryInventoryin classAbstractPneumaticCraftBlockEntity
-
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:
getRenderBoundingBoxin interfacenet.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:IManoMeasurableThis method is invoked by the Manometer when a player right-clicks a BE or Entity with this interface implemented.- Specified by:
printManometerMessagein interfaceIManoMeasurable- Parameters:
player- player who is right-clicking the measurable BE, and therefore needs to get the messagetext- 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:CamouflageableBlockEntityGet the camouflage state; the blockstate which will be used to render this block entity's block.- Specified by:
getCamouflagein interfaceCamouflageableBlockEntity- 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:CamouflageableBlockEntitySet 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:
setCamouflagein interfaceCamouflageableBlockEntity- 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()
-