Package net.minecraft.tileentity
Class ChestTileEntity
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description private LazyOptional<IItemHandlerModifiable>chestHandlerprivate NonNullList<ItemStack>itemsprotected floatoOpennessprotected intopenCountprotected floatopennessprivate inttickInterval-
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
Constructors Modifier Constructor Description ChestTileEntity()protectedChestTileEntity(TileEntityType<?> p_i48287_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()private IItemHandlerModifiablecreateHandler()protected 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.intgetContainerSize()protected ITextComponentgetDefaultName()protected 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 voidinvalidateCaps()voidload(BlockState p_230337_1_, CompoundNBT p_230337_2_)private voidplaySound(SoundEvent p_195483_1_)CompoundNBTsave(CompoundNBT p_189515_1_)protected voidsetItems(NonNullList<ItemStack> p_199721_1_)protected voidsignalOpenCount()voidstartOpen(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, 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 Detail
-
items
private NonNullList<ItemStack> items
-
openness
protected float openness
-
oOpenness
protected float oOpenness
-
openCount
protected int openCount
-
tickInterval
private int tickInterval
-
chestHandler
private LazyOptional<IItemHandlerModifiable> chestHandler
-
-
Constructor Detail
-
ChestTileEntity
protected ChestTileEntity(TileEntityType<?> p_i48287_1_)
-
ChestTileEntity
public ChestTileEntity()
-
-
Method Detail
-
getContainerSize
public int getContainerSize()
- Specified by:
getContainerSizein interfaceIInventory
-
getDefaultName
protected ITextComponent getDefaultName()
- Specified by:
getDefaultNamein classLockableTileEntity
-
load
public void load(BlockState p_230337_1_, CompoundNBT p_230337_2_)
- Overrides:
loadin classLockableTileEntity
-
save
public CompoundNBT save(CompoundNBT p_189515_1_)
- 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
private void playSound(SoundEvent p_195483_1_)
-
triggerEvent
public boolean triggerEvent(int p_145842_1_, int p_145842_2_)- Overrides:
triggerEventin classTileEntity
-
startOpen
public void startOpen(PlayerEntity p_174889_1_)
- Specified by:
startOpenin interfaceIInventory
-
stopOpen
public void stopOpen(PlayerEntity p_174886_1_)
- Specified by:
stopOpenin interfaceIInventory
-
signalOpenCount
protected void signalOpenCount()
-
getItems
protected NonNullList<ItemStack> getItems()
- Specified by:
getItemsin classLockableLootTileEntity
-
setItems
protected void setItems(NonNullList<ItemStack> p_199721_1_)
- Specified by:
setItemsin classLockableLootTileEntity
-
getOpenNess
public float getOpenNess(float p_195480_1_)
- Specified by:
getOpenNessin interfaceIChestLid
-
getOpenCount
public static int getOpenCount(IBlockReader p_195481_0_, BlockPos p_195481_1_)
-
swapContents
public static void swapContents(ChestTileEntity p_199722_0_, ChestTileEntity p_199722_1_)
-
createMenu
protected Container createMenu(int p_213906_1_, PlayerInventory p_213906_2_)
- Specified by:
createMenuin classLockableTileEntity
-
clearCache
public void clearCache()
- Overrides:
clearCachein classTileEntity
-
getCapability
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side)
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
private IItemHandlerModifiable createHandler()
-
invalidateCaps
protected void invalidateCaps()
- Overrides:
invalidateCapsin classLockableTileEntity
-
-