Package net.minecraft.tileentity
Class ChestTileEntity
- All Implemented Interfaces:
IContainerProvider
,INamedContainerProvider
,IClearable
,IInventory
,IChestLid
,ITickableTileEntity
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeTileEntity
,INBTSerializable<CompoundNBT>
- Direct Known Subclasses:
TrappedChestTileEntity
public class ChestTileEntity
extends LockableLootTileEntity
implements IChestLid, ITickableTileEntity
-
Field Summary
Modifier and TypeFieldDescriptionprivate LazyOptional<IItemHandlerModifiable>
private NonNullList<ItemStack>
protected float
protected int
protected float
private int
Fields inherited from class net.minecraft.tileentity.LockableLootTileEntity
lootTable, lootTableSeed
Fields inherited from class net.minecraft.tileentity.TileEntity
level, remove, worldPosition
Fields inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
INFINITE_EXTENT_AABB
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
private IItemHandlerModifiable
protected Container
createMenu
(int p_213906_1_, PlayerInventory p_213906_2_) <T> LazyOptional<T>
getCapability
(Capability<T> cap, Direction side) Retrieves the Optional handler for the capability requested on the specific side.int
protected ITextComponent
protected NonNullList<ItemStack>
getItems()
static int
getOpenCount
(IBlockReader p_195481_0_, BlockPos p_195481_1_) static int
getOpenCount
(World p_213976_0_, LockableTileEntity p_213976_1_, int p_213976_2_, int p_213976_3_, int p_213976_4_) static int
getOpenCount
(World p_213977_0_, LockableTileEntity p_213977_1_, int p_213977_2_, int p_213977_3_, int p_213977_4_, int p_213977_5_, int p_213977_6_) float
getOpenNess
(float p_195480_1_) protected void
void
load
(BlockState p_230337_1_, CompoundNBT p_230337_2_) private void
playSound
(SoundEvent p_195483_1_) save
(CompoundNBT p_189515_1_) protected void
setItems
(NonNullList<ItemStack> p_199721_1_) protected void
void
startOpen
(PlayerEntity p_174889_1_) void
stopOpen
(PlayerEntity p_174886_1_) static void
swapContents
(ChestTileEntity p_199722_0_, ChestTileEntity p_199722_1_) void
tick()
boolean
triggerEvent
(int p_145842_1_, int p_145842_2_) Methods inherited from class net.minecraft.tileentity.LockableLootTileEntity
canOpen, clearContent, createMenu, getItem, isEmpty, removeItem, removeItemNoUpdate, setItem, setLootTable, setLootTable, stillValid, tryLoadLootTable, trySaveLootTable, unpackLootTable
Methods inherited from class net.minecraft.tileentity.LockableTileEntity
canUnlock, createUnSidedHandler, getCustomName, getDisplayName, getName, setCustomName
Methods inherited from class net.minecraft.tileentity.TileEntity
clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getTileData, getType, getUpdatePacket, getUpdateTag, getViewDistance, hasLevel, isRemoved, loadStatic, logInvalidState, mirror, onChunkUnloaded, onlyOpCanSetNbt, rotate, setChanged, setLevelAndPosition, setPosition, setRemoved
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
deserializeNBT, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
Methods inherited from interface net.minecraft.inventory.IInventory
canPlaceItem, countItem, getMaxStackSize, hasAnyOf, setChanged
Methods inherited from interface net.minecraft.util.INameable
hasCustomName
-
Field Details
-
items
-
openness
protected float openness -
oOpenness
protected float oOpenness -
openCount
protected int openCount -
tickInterval
private int tickInterval -
chestHandler
-
-
Constructor Details
-
ChestTileEntity
-
ChestTileEntity
public ChestTileEntity()
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceIInventory
-
getDefaultName
- Specified by:
getDefaultName
in classLockableTileEntity
-
load
- Overrides:
load
in classLockableTileEntity
-
save
- Overrides:
save
in classLockableTileEntity
-
tick
public void tick()- Specified by:
tick
in interfaceITickableTileEntity
-
getOpenCount
public static int getOpenCount(World p_213977_0_, LockableTileEntity p_213977_1_, int p_213977_2_, int p_213977_3_, int p_213977_4_, int p_213977_5_, int p_213977_6_) -
getOpenCount
public static int getOpenCount(World p_213976_0_, LockableTileEntity p_213976_1_, int p_213976_2_, int p_213976_3_, int p_213976_4_) -
playSound
-
triggerEvent
public boolean triggerEvent(int p_145842_1_, int p_145842_2_) - Overrides:
triggerEvent
in classTileEntity
-
startOpen
- Specified by:
startOpen
in interfaceIInventory
-
stopOpen
- Specified by:
stopOpen
in interfaceIInventory
-
signalOpenCount
protected void signalOpenCount() -
getItems
- Specified by:
getItems
in classLockableLootTileEntity
-
setItems
- Specified by:
setItems
in classLockableLootTileEntity
-
getOpenNess
public float getOpenNess(float p_195480_1_) - Specified by:
getOpenNess
in interfaceIChestLid
-
getOpenCount
-
swapContents
-
createMenu
- Specified by:
createMenu
in classLockableTileEntity
-
clearCache
public void clearCache()- Overrides:
clearCache
in classTileEntity
-
getCapability
Description copied from interface:ICapabilityProvider
Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.- Specified by:
getCapability
in interfaceICapabilityProvider
- Overrides:
getCapability
in classLockableTileEntity
- Returns:
- The requested an optional holding the requested capability.
-
createHandler
-
invalidateCaps
protected void invalidateCaps()- Overrides:
invalidateCaps
in classLockableTileEntity
-