Class ElevatorBaseBlockEntity
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.ElevatorBaseBlockEntity
- All Implemented Interfaces:
CamouflageableBlockEntity,IGUIButtonSensitive,IGUITextFieldSensitive,ILuaMethodProvider,IMinWorkingPressure,IRedstoneControl<ElevatorBaseBlockEntity>,IDescSynced,IUpgradeHolder,net.minecraft.world.inventory.MenuConstructor,net.minecraft.world.MenuProvider,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>
public class ElevatorBaseBlockEntity
extends AbstractAirHandlingBlockEntity
implements IGUITextFieldSensitive, IRedstoneControl<ElevatorBaseBlockEntity>, IMinWorkingPressure, CamouflageableBlockEntity, net.minecraft.world.MenuProvider
-
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
FieldsModifier and TypeFieldDescriptiondoublefloat[]int[]intintdoubleintFields 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
ConstructorsConstructorDescriptionElevatorBaseBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLuaMethods(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.net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int i, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player playerEntity) net.minecraft.world.level.block.state.BlockStateGet the camouflage state; the blockstate which will be used to render this block entity's block.getFloorName(int floor) floatfloatGet the minimum pressure at which this machine can operate.net.minecraftforge.items.IItemHandlerGet the redstone controller object for this BEnet.minecraft.network.chat.MutableComponentnet.minecraft.world.phys.AABBdoublegetText(int textFieldID) voidgoToFloor(int floor) voidhandleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) booleanbooleanisGuiUseableByPlayer(net.minecraft.world.entity.player.Player par1EntityPlayer) booleanvoidload(net.minecraft.nbt.CompoundTag tag) voidElevator above us has just been broken; move its upgrades and camo to this elevator base, if possible.voidonLoad()voidonNeighborBlockUpdate(net.minecraft.core.BlockPos fromPos) Called when a neighboring block changes state (i.e.voidonRedstoneModeChanged(int newModeIdx) voidreadFromPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) voidsetCamouflage(net.minecraft.world.level.block.state.BlockState state) Set the camouflage for the block entity.voidsetFloorName(int floor, String name) voidvoidCalled on both server and client, before anything elsevoidupdateFloors(boolean notifyClient) voidvoidwriteToPacket(net.minecraft.nbt.CompoundTag tag) Encoded into the description packet.Methods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractAirHandlingBlockEntity
addAir, getCapability, getCriticalPressure, getDangerPressure, getDefaultVolume, getPressure, handleUpdateTag, hasNoConnectedAirHandlers, initializeHullAirHandlerClient, initializeHullAirHandlers, onBlockRotated, onUpgradesChanged, setRemovedMethods 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, getEnergyCap, getFluidCap, getHeatCap, getInventoryCap, getLuaMethodRegistry, getModelData, getName, getPeripheralType, getPosition, getRotation, getSpeedMultiplierFromUpgrades, getSpeedUsageMultiplierFromUpgrades, getUpdateTag, getUpgradeCache, getUpgradeHandler, getUpgrades, 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, 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, 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, hasCustomOutlineRendering, onDataPacket, serializeNBTMethods inherited from interface me.desht.pneumaticcraft.common.block.entity.IRedstoneControl
getCurrentRedstonePower, getRedstoneModeMethods inherited from interface net.minecraft.world.MenuProvider
getDisplayNameMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
extension
public double extension -
multiElevatorCount
public int multiElevatorCount -
oldExtension
public double oldExtension -
floorHeights
public int[] floorHeights -
ticksRunning
public int ticksRunning -
fakeFloorTextureUV
public float[] fakeFloorTextureUV -
lightAbove
public int lightAbove
-
-
Constructor Details
-
ElevatorBaseBlockEntity
public ElevatorBaseBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
tickCommonPre
public void tickCommonPre()Description copied from class:AbstractTickingBlockEntityCalled on both server and client, before anything else- Overrides:
tickCommonPrein classAbstractAirHandlingBlockEntity
-
onLoad
public void onLoad()- Specified by:
onLoadin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
onLoadin classAbstractAirHandlingBlockEntity
-
isStopped
public boolean isStopped() -
handleGUIButtonPress
public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) - Specified by:
handleGUIButtonPressin interfaceIGUIButtonSensitive- Overrides:
handleGUIButtonPressin classAbstractPneumaticCraftBlockEntity
-
onRedstoneModeChanged
public void onRedstoneModeChanged(int newModeIdx) - Specified by:
onRedstoneModeChangedin interfaceIRedstoneControl<ElevatorBaseBlockEntity>
-
getMaxElevatorHeight
public float getMaxElevatorHeight() -
updateMaxElevatorHeight
public void updateMaxElevatorHeight() -
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classAbstractAirHandlingBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classAbstractAirHandlingBlockEntity
-
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
-
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
-
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
-
moveUpgradesFromAbove
public void moveUpgradesFromAbove()Elevator above us has just been broken; move its upgrades and camo to this elevator base, if possible. -
updateFloors
public void updateFloors(boolean notifyClient) -
goToFloor
public void goToFloor(int floor) -
getTargetExtension
public double getTargetExtension() -
getRenderBoundingBox
public net.minecraft.world.phys.AABB getRenderBoundingBox()- Specified by:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
isCoreElevator
public boolean isCoreElevator() -
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
-
setText
- Specified by:
setTextin interfaceIGUITextFieldSensitive
-
getText
- Specified by:
getTextin interfaceIGUITextFieldSensitive
-
getFloorName
-
setFloorName
-
isGuiUseableByPlayer
public boolean isGuiUseableByPlayer(net.minecraft.world.entity.player.Player par1EntityPlayer) - Overrides:
isGuiUseableByPlayerin classAbstractPneumaticCraftBlockEntity
-
addLuaMethods
Description copied from interface:ILuaMethodProviderCalled lazily to populate the method registry with the methods.- Specified by:
addLuaMethodsin interfaceILuaMethodProvider- Overrides:
addLuaMethodsin classAbstractAirHandlingBlockEntity- Parameters:
registry- the registry to populate
-
getPrimaryInventory
public net.minecraftforge.items.IItemHandler getPrimaryInventory()- Specified by:
getPrimaryInventoryin classAbstractPneumaticCraftBlockEntity
-
getRedstoneController
Description copied from interface:IRedstoneControlGet the redstone controller object for this BE- Specified by:
getRedstoneControllerin interfaceIRedstoneControl<ElevatorBaseBlockEntity>- Returns:
- the redstone controller
-
getMinWorkingPressure
public float getMinWorkingPressure()Description copied from interface:IMinWorkingPressureGet the minimum pressure at which this machine can operate. Used for GUI display purposes (drawing the yellow region of the pressure gauge, but can also be checked elsewhere.- Specified by:
getMinWorkingPressurein interfaceIMinWorkingPressure- Returns:
- the minimum pressure at which this machine can operate
-
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
-
getRedstoneTabTitle
public net.minecraft.network.chat.MutableComponent getRedstoneTabTitle()- Specified by:
getRedstoneTabTitlein interfaceIRedstoneControl<ElevatorBaseBlockEntity>
-
createMenu
@Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int i, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player playerEntity) - Specified by:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-