Package net.minecraft.tileentity
Class DispenserTileEntity
- java.lang.Object
-
- net.minecraftforge.common.capabilities.CapabilityProvider<TileEntity>
-
- net.minecraft.tileentity.TileEntity
-
- net.minecraft.tileentity.LockableTileEntity
-
- net.minecraft.tileentity.LockableLootTileEntity
-
- net.minecraft.tileentity.DispenserTileEntity
-
- All Implemented Interfaces:
IContainerProvider
,INamedContainerProvider
,IClearable
,IInventory
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeTileEntity
,INBTSerializable<CompoundNBT>
- Direct Known Subclasses:
DropperTileEntity
public class DispenserTileEntity extends LockableLootTileEntity
-
-
Field Summary
Fields Modifier and Type Field Description private NonNullList<ItemStack>
items
private static java.util.Random
RANDOM
-
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 DispenserTileEntity()
protected
DispenserTileEntity(TileEntityType<?> p_i48286_1_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addItem(ItemStack p_146019_1_)
protected Container
createMenu(int p_213906_1_, PlayerInventory p_213906_2_)
int
getContainerSize()
protected ITextComponent
getDefaultName()
protected NonNullList<ItemStack>
getItems()
int
getRandomSlot()
void
load(BlockState p_230337_1_, CompoundNBT p_230337_2_)
CompoundNBT
save(CompoundNBT p_189515_1_)
protected void
setItems(NonNullList<ItemStack> p_199721_1_)
-
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, getCapability, getCustomName, getDisplayName, getName, invalidateCaps, setCustomName
-
Methods inherited from class net.minecraft.tileentity.TileEntity
clearCache, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getTileData, getType, getUpdatePacket, getUpdateTag, getViewDistance, hasLevel, isRemoved, loadStatic, logInvalidState, mirror, onChunkUnloaded, onlyOpCanSetNbt, rotate, setChanged, setLevelAndPosition, setPosition, setRemoved, triggerEvent
-
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, startOpen, stopOpen
-
Methods inherited from interface net.minecraft.util.INameable
hasCustomName
-
-
-
-
Field Detail
-
RANDOM
private static final java.util.Random RANDOM
-
items
private NonNullList<ItemStack> items
-
-
Constructor Detail
-
DispenserTileEntity
protected DispenserTileEntity(TileEntityType<?> p_i48286_1_)
-
DispenserTileEntity
public DispenserTileEntity()
-
-
Method Detail
-
getContainerSize
public int getContainerSize()
-
getRandomSlot
public int getRandomSlot()
-
addItem
public int addItem(ItemStack p_146019_1_)
-
getDefaultName
protected ITextComponent getDefaultName()
- Specified by:
getDefaultName
in classLockableTileEntity
-
load
public void load(BlockState p_230337_1_, CompoundNBT p_230337_2_)
- Overrides:
load
in classLockableTileEntity
-
save
public CompoundNBT save(CompoundNBT p_189515_1_)
- Overrides:
save
in classLockableTileEntity
-
getItems
protected NonNullList<ItemStack> getItems()
- Specified by:
getItems
in classLockableLootTileEntity
-
setItems
protected void setItems(NonNullList<ItemStack> p_199721_1_)
- Specified by:
setItems
in classLockableLootTileEntity
-
createMenu
protected Container createMenu(int p_213906_1_, PlayerInventory p_213906_2_)
- Specified by:
createMenu
in classLockableTileEntity
-
-