public class DispenserBlockEntity extends LootableContainerBlockEntity
Modifier and Type | Field and Description |
---|---|
private DefaultedList<ItemStack> |
inventory |
private static Random |
RANDOM |
lootTableId, lootTableSeed
pos, removed, world
Modifier | Constructor and Description |
---|---|
|
DispenserBlockEntity() |
protected |
DispenserBlockEntity(BlockEntityType<?> type) |
Modifier and Type | Method and Description |
---|---|
int |
addToFirstFreeSlot(ItemStack stack) |
int |
chooseNonEmptySlot() |
protected ScreenHandler |
createScreenHandler(int syncId,
PlayerInventory playerInventory) |
void |
fromTag(BlockState state,
CompoundTag tag) |
protected Text |
getContainerName() |
protected DefaultedList<ItemStack> |
getInvStackList() |
protected void |
setInvStackList(DefaultedList<ItemStack> list) |
int |
size() |
CompoundTag |
toTag(CompoundTag tag) |
canPlayerUse, checkLootInteraction, checkUnlocked, clear, createMenu, deserializeLootTable, getStack, isEmpty, removeStack, removeStack, serializeLootTable, setLootTable, setLootTable, setStack
checkUnlocked, getCustomName, getDisplayName, getName, setCustomName
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacket
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsAny, count, getMaxCountPerStack, isValid, markDirty, onClose, onOpen
hasCustomName
private static final Random RANDOM
private DefaultedList<ItemStack> inventory
protected DispenserBlockEntity(BlockEntityType<?> type)
public DispenserBlockEntity()
public int size()
public int chooseNonEmptySlot()
public int addToFirstFreeSlot(ItemStack stack)
protected Text getContainerName()
getContainerName
in class LockableContainerBlockEntity
public void fromTag(BlockState state, CompoundTag tag)
fromTag
in class LockableContainerBlockEntity
public CompoundTag toTag(CompoundTag tag)
toTag
in class LockableContainerBlockEntity
protected DefaultedList<ItemStack> getInvStackList()
getInvStackList
in class LootableContainerBlockEntity
protected void setInvStackList(DefaultedList<ItemStack> list)
setInvStackList
in class LootableContainerBlockEntity
protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory)
createScreenHandler
in class LockableContainerBlockEntity