Class ChargingStationBlockEntity
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.ChargingStationBlockEntity
- All Implemented Interfaces:
CamouflageableBlockEntity,IGUIButtonSensitive,ILuaMethodProvider,IRedstoneControl<ChargingStationBlockEntity>,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 ChargingStationBlockEntity
extends AbstractAirHandlingBlockEntity
implements IRedstoneControl<ChargingStationBlockEntity>, 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 TypeFieldDescriptionstatic final intbooleanfloatbooleanbooleanFields 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
ConstructorsConstructorDescriptionChargingStationBlockEntity(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.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.net.minecraft.world.item.ItemStacknet.minecraft.world.item.ItemStackprotected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>getInventoryCap(net.minecraft.core.Direction side) net.minecraftforge.items.IItemHandlerGet the redstone controller object for this BEnet.minecraft.world.phys.AABBvoidhandleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) voidload(net.minecraft.nbt.CompoundTag tag) 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) voidserializeExtraItemData(net.minecraft.nbt.CompoundTag blockEntityTag, boolean preserveState) Get any extra data to be serialized onto a dropped item stack.voidsetCamouflage(net.minecraft.world.level.block.state.BlockState state) Set the camouflage for the block entity.voidprotected booleanvoidvoidwriteToPacket(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, onLoad, onNeighborBlockUpdate, reviveCaps, tickCommonPreMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
tickClient, tickCommonPostMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
countPlayersUsing, getCachedNeighbor, getContentsToDrop, getCurrentRecipeIdSynced, getCustomName, getDescriptionFields, getDisplayName, getEnergyCap, getFluidCap, getHeatCap, getLuaMethodRegistry, getModelData, getName, getPeripheralType, getPosition, getRotation, getSpeedMultiplierFromUpgrades, getSpeedUsageMultiplierFromUpgrades, getUpdateTag, getUpgradeCache, getUpgradeHandler, getUpgrades, isGuiUseableByPlayer, nonNullLevel, onDescUpdate, onGuiUpdate, onNeighborTileUpdate, requestModelDataUpdate, sendDescriptionPacket, setChanged, setCustomName, setPreserveStateOnBreak, shouldPreserveStateOnBreak, shouldSyncField, updateNeighboursMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, 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 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, getRedstoneMode, getRedstoneTabTitle, onRedstoneModeChangedMethods inherited from interface net.minecraft.world.MenuProvider
getDisplayNameMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
CHARGE_INVENTORY_INDEX
public static final int CHARGE_INVENTORY_INDEX- See Also:
-
chargingItemPressure
public float chargingItemPressure -
charging
public boolean charging -
discharging
public boolean discharging -
upgradeOnly
public boolean upgradeOnly
-
-
Constructor Details
-
ChargingStationBlockEntity
public ChargingStationBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getChargingStack
@Nonnull public net.minecraft.world.item.ItemStack getChargingStack() -
getChargingStackSynced
@Nonnull public net.minecraft.world.item.ItemStack getChargingStackSynced() -
tickServer
public void tickServer()- Overrides:
tickServerin classAbstractTickingBlockEntity
-
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
-
handleGUIButtonPress
public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) - Specified by:
handleGUIButtonPressin interfaceIGUIButtonSensitive- Overrides:
handleGUIButtonPressin classAbstractPneumaticCraftBlockEntity
-
getPrimaryInventory
public net.minecraftforge.items.IItemHandler getPrimaryInventory()- Specified by:
getPrimaryInventoryin classAbstractPneumaticCraftBlockEntity
-
getRenderBoundingBox
public net.minecraft.world.phys.AABB getRenderBoundingBox()- Specified by:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
getChargeableInventory
-
getInventoryCap
protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler> getInventoryCap(net.minecraft.core.Direction side) - Overrides:
getInventoryCapin classAbstractPneumaticCraftBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classAbstractAirHandlingBlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classAbstractAirHandlingBlockEntity
-
serializeExtraItemData
public void serializeExtraItemData(net.minecraft.nbt.CompoundTag blockEntityTag, boolean preserveState) Description copied from class:AbstractPneumaticCraftBlockEntityGet any extra data to be serialized onto a dropped item stack. The supplied tag is the "BlockEntityTag" subtag of the item's NBT data, so will be automatically deserialized into the BE (i.e. available toBlockEntity.load(CompoundTag)method) when the itemblock is next placed.- Overrides:
serializeExtraItemDatain classAbstractPneumaticCraftBlockEntity- Parameters:
blockEntityTag- the existing "BlockEntityTag" subtag to add data topreserveState- true when dropped with a wrench, false when broken with a pickaxe etc.
-
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
-
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
-
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 classAbstractAirHandlingBlockEntity
-
getRedstoneController
Description copied from interface:IRedstoneControlGet the redstone controller object for this BE- Specified by:
getRedstoneControllerin interfaceIRedstoneControl<ChargingStationBlockEntity>- Returns:
- the redstone controller
-
shouldRerenderChunkOnDescUpdate
protected boolean shouldRerenderChunkOnDescUpdate()- Overrides:
shouldRerenderChunkOnDescUpdatein classAbstractPneumaticCraftBlockEntity
-
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
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin classAbstractAirHandlingBlockEntity
-
clearRemoved
public void clearRemoved()- Overrides:
clearRemovedin classnet.minecraft.world.level.block.entity.BlockEntity
-
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
-