Class SmartChestBlockEntity
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.SmartChestBlockEntity
- All Implemented Interfaces:
IComparatorSupport,IGUIButtonSensitive,ILuaMethodProvider,IRedstoneControl<SmartChestBlockEntity>,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 SmartChestBlockEntity
extends AbstractTickingBlockEntity
implements net.minecraft.world.MenuProvider, IRedstoneControl<SmartChestBlockEntity>, IComparatorSupport
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classNested 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
ConstructorsConstructorDescriptionSmartChestBlockEntity(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) voidcycleMode(SideConfigurator.RelativeFace face, boolean shiftHeld) static net.minecraftforge.items.IItemHandlerdeserializeSmartChest(net.minecraft.nbt.CompoundTag tag) net.minecraft.core.DirectiongetAbsoluteFacing(SideConfigurator.RelativeFace face, net.minecraft.core.Direction dir) intvoidgetContentsToDrop(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> drops) Collect all items which should be dropped when this BE is broken.net.minecraft.world.item.ItemStackgetFilter(int slotId) protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.items.IItemHandler>intintnet.minecraftforge.items.IItemHandlerGet the redstone controller object for this BEintvoidhandleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) voidload(net.minecraft.nbt.CompoundTag tag) 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.voidsetFilter(int slotId, net.minecraft.world.item.ItemStack stack) voidvoidsetLastSlot(int lastSlot) 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.voidvoidMethods inherited from class me.desht.pneumaticcraft.common.block.entity.AbstractTickingBlockEntity
tickCommonPost, tickCommonPreMethods 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, 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 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
-
CHEST_SIZE
public static final int CHEST_SIZE- See Also:
-
-
Constructor Details
-
SmartChestBlockEntity
public SmartChestBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
tickClient
public void tickClient()- Overrides:
tickClientin classAbstractTickingBlockEntity
-
tickServer
public void tickServer()- Overrides:
tickServerin classAbstractTickingBlockEntity
-
getTickRate
public int getTickRate() -
getMaxItems
public int getMaxItems() -
getAbsoluteFacing
public net.minecraft.core.Direction getAbsoluteFacing(SideConfigurator.RelativeFace face, net.minecraft.core.Direction dir) -
getPushPullMode
-
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
-
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
-
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
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classAbstractPneumaticCraftBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classAbstractPneumaticCraftBlockEntity
-
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.
-
handleGUIButtonPress
public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) - Specified by:
handleGUIButtonPressin interfaceIGUIButtonSensitive- Overrides:
handleGUIButtonPressin classAbstractPneumaticCraftBlockEntity
-
cycleMode
-
getLastSlot
public int getLastSlot() -
setLastSlot
public void setLastSlot(int lastSlot) -
getFilter
-
setFilter
-
getFilter
public net.minecraft.world.item.ItemStack getFilter(int slotId) -
setFilter
public void setFilter(int slotId, net.minecraft.world.item.ItemStack stack) -
getRedstoneController
Description copied from interface:IRedstoneControlGet the redstone controller object for this BE- Specified by:
getRedstoneControllerin interfaceIRedstoneControl<SmartChestBlockEntity>- Returns:
- the redstone controller
-
getComparatorValue
public int getComparatorValue()- Specified by:
getComparatorValuein interfaceIComparatorSupport
-
deserializeSmartChest
public static net.minecraftforge.items.IItemHandler deserializeSmartChest(net.minecraft.nbt.CompoundTag tag)
-