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
FieldsModifier and TypeFieldDescriptionprivate LazyOptional<IItemHandlerModifiable>private NonNullList<ItemStack>protected floatprotected intprotected floatprivate intFields inherited from class net.minecraft.tileentity.LockableLootTileEntity
lootTable, lootTableSeedFields inherited from class net.minecraft.tileentity.TileEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
INFINITE_EXTENT_AABB -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate IItemHandlerModifiableprotected ContainercreateMenu(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.intprotected ITextComponentprotected NonNullList<ItemStack>getItems()static intgetOpenCount(IBlockReader p_195481_0_, BlockPos p_195481_1_) static intgetOpenCount(World p_213976_0_, LockableTileEntity p_213976_1_, int p_213976_2_, int p_213976_3_, int p_213976_4_) static intgetOpenCount(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_) floatgetOpenNess(float p_195480_1_) protected voidvoidload(BlockState p_230337_1_, CompoundNBT p_230337_2_) private voidplaySound(SoundEvent p_195483_1_) save(CompoundNBT p_189515_1_) protected voidsetItems(NonNullList<ItemStack> p_199721_1_) protected voidvoidstartOpen(PlayerEntity p_174889_1_) voidstopOpen(PlayerEntity p_174886_1_) static voidswapContents(ChestTileEntity p_199722_0_, ChestTileEntity p_199722_1_) voidtick()booleantriggerEvent(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, unpackLootTableMethods inherited from class net.minecraft.tileentity.LockableTileEntity
canUnlock, createUnSidedHandler, getCustomName, getDisplayName, getName, setCustomNameMethods 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, setRemovedMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, 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.IForgeTileEntity
deserializeNBT, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBTMethods inherited from interface net.minecraft.inventory.IInventory
canPlaceItem, countItem, getMaxStackSize, hasAnyOf, setChangedMethods 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:
getContainerSizein interfaceIInventory
-
getDefaultName
- Specified by:
getDefaultNamein classLockableTileEntity
-
load
- Overrides:
loadin classLockableTileEntity
-
save
- Overrides:
savein classLockableTileEntity
-
tick
public void tick()- Specified by:
tickin 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:
triggerEventin classTileEntity
-
startOpen
- Specified by:
startOpenin interfaceIInventory
-
stopOpen
- Specified by:
stopOpenin interfaceIInventory
-
signalOpenCount
protected void signalOpenCount() -
getItems
- Specified by:
getItemsin classLockableLootTileEntity
-
setItems
- Specified by:
setItemsin classLockableLootTileEntity
-
getOpenNess
public float getOpenNess(float p_195480_1_) - Specified by:
getOpenNessin interfaceIChestLid
-
getOpenCount
-
swapContents
-
createMenu
- Specified by:
createMenuin classLockableTileEntity
-
clearCache
public void clearCache()- Overrides:
clearCachein classTileEntity
-
getCapability
Description copied from interface:ICapabilityProviderRetrieves 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:
getCapabilityin interfaceICapabilityProvider- Overrides:
getCapabilityin classLockableTileEntity- Returns:
- The requested an optional holding the requested capability.
-
createHandler
-
invalidateCaps
protected void invalidateCaps()- Overrides:
invalidateCapsin classLockableTileEntity
-