public class DispenserBlockEntity extends LootableContainerBlockEntity
| Modifier and Type | Field and Description |
|---|---|
private DefaultedList<ItemStack> |
inventory |
private static Random |
RANDOM |
lootTableId, lootTableSeedpos, 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, setStackcheckUnlocked, getCustomName, getDisplayName, getName, setCustomNameapplyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacketclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsAny, count, getMaxCountPerStack, isValid, markDirty, onClose, onOpenhasCustomNameprivate 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 LockableContainerBlockEntitypublic void fromTag(BlockState state, CompoundTag tag)
fromTag in class LockableContainerBlockEntitypublic CompoundTag toTag(CompoundTag tag)
toTag in class LockableContainerBlockEntityprotected DefaultedList<ItemStack> getInvStackList()
getInvStackList in class LootableContainerBlockEntityprotected void setInvStackList(DefaultedList<ItemStack> list)
setInvStackList in class LootableContainerBlockEntityprotected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory)
createScreenHandler in class LockableContainerBlockEntity