Class ReinforcedChestBlockEntity
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.ReinforcedChestBlockEntity
- All Implemented Interfaces:
IComparatorSupport,IGUIButtonSensitive,ILuaMethodProvider,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 ReinforcedChestBlockEntity
extends AbstractPneumaticCraftBlockEntity
implements net.minecraft.world.MenuProvider, IComparatorSupport
-
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
ConstructorsConstructorDescriptionReinforcedChestBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.inventory.AbstractContainerMenucreateMenu(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.entity.player.Player player) intvoidgetContentsToDrop(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> drops) Collect all items which should be dropped when this BE is broken.protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>net.minecraftforge.items.IItemHandlervoidload(net.minecraft.nbt.CompoundTag tag) voidmaybeFillWithLoot(net.minecraft.world.entity.player.Player player) 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.booleanShould this block entity preserve its state (currently: upgrades and stored air) when broken? By default this is true when sneak-wrenched, and false when broken by pick.Methods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractPneumaticCraftBlockEntity
addLuaMethods, countPlayersUsing, getCachedNeighbor, getCapability, getCurrentRecipeIdSynced, getCustomName, getDescriptionFields, getDisplayName, getHeatCap, getLuaMethodRegistry, getModelData, getName, getPeripheralType, getPosition, getRotation, getSpeedMultiplierFromUpgrades, getSpeedUsageMultiplierFromUpgrades, getUpdateTag, getUpgradeCache, getUpgradeHandler, getUpgrades, handleGUIButtonPress, handleUpdateTag, isGuiUseableByPlayer, nonNullLevel, onBlockRotated, onDescUpdate, onGuiUpdate, onLoad, onNeighborBlockUpdate, onNeighborTileUpdate, onUpgradesChanged, readFromPacket, requestModelDataUpdate, sendDescriptionPacket, setChanged, setCustomName, setPreserveStateOnBreak, setRemoved, shouldRerenderChunkOnDescUpdate, shouldSyncField, updateNeighbours, writeToPacketMethods 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.MenuProvider
getDisplayNameMethods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
CHEST_SIZE
public static final int CHEST_SIZE- See Also:
-
NBT_ITEMS
- See Also:
-
-
Constructor Details
-
ReinforcedChestBlockEntity
public ReinforcedChestBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getPrimaryInventory
public net.minecraftforge.items.IItemHandler getPrimaryInventory()- Specified by:
getPrimaryInventoryin classAbstractPneumaticCraftBlockEntity
-
getInventoryCap
@Nonnull protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler> getInventoryCap()- Overrides:
getInventoryCapin 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
-
shouldPreserveStateOnBreak
public boolean shouldPreserveStateOnBreak()Description copied from class:AbstractPneumaticCraftBlockEntityShould this block entity preserve its state (currently: upgrades and stored air) when broken? By default this is true when sneak-wrenched, and false when broken by pick.- Overrides:
shouldPreserveStateOnBreakin classAbstractPneumaticCraftBlockEntity- Returns:
- true if state should be preserved, false otherwise
-
getContentsToDrop
public void getContentsToDrop(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> drops) Description copied from class:AbstractPneumaticCraftBlockEntityCollect all items which should be dropped when this BE is broken. Override and extend this in subclassing BE's which have extra inventories to be dropped.- Overrides:
getContentsToDropin classAbstractPneumaticCraftBlockEntity- Parameters:
drops- list in which to collect dropped items
-
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.
-
createMenu
@Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.entity.player.Player player) - Specified by:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-
maybeFillWithLoot
public void maybeFillWithLoot(net.minecraft.world.entity.player.Player player) -
getComparatorValue
public int getComparatorValue()- Specified by:
getComparatorValuein interfaceIComparatorSupport
-