Package net.minecraft.block.entity
Class DispenserBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LockableContainerBlockEntity
net.minecraft.block.entity.LootableContainerBlockEntity
net.minecraft.block.entity.DispenserBlockEntity
- All Implemented Interfaces:
Inventory
,NamedScreenHandlerFactory
,ScreenHandlerFactory
,Clearable
,Nameable
- Direct Known Subclasses:
DropperBlockEntity
public class DispenserBlockEntity extends LootableContainerBlockEntity
-
Field Summary
Fields Modifier and Type Field Description private DefaultedList<ItemStack>
inventory
private static Random
RANDOM
Fields inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
lootTableId, lootTableSeed
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
Constructors Modifier Constructor Description DispenserBlockEntity()
protected
DispenserBlockEntity(BlockEntityType<?> type)
-
Method Summary
Modifier and Type Method 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)
Methods inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
canPlayerUse, checkLootInteraction, checkUnlocked, clear, createMenu, deserializeLootTable, getStack, isEmpty, removeStack, removeStack, serializeLootTable, setLootTable, setLootTable, setStack
Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, getCustomName, getDisplayName, getName, setCustomName
Methods inherited from class net.minecraft.block.entity.BlockEntity
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacket
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
containsAny, count, getMaxCountPerStack, isValid, markDirty, onClose, onOpen
Methods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
RANDOM
-
inventory
-
-
Constructor Details
-
DispenserBlockEntity
-
DispenserBlockEntity
public DispenserBlockEntity()
-
-
Method Details
-
size
public int size() -
chooseNonEmptySlot
public int chooseNonEmptySlot() -
addToFirstFreeSlot
-
getContainerName
- Specified by:
getContainerName
in classLockableContainerBlockEntity
-
fromTag
- Overrides:
fromTag
in classLockableContainerBlockEntity
-
toTag
- Overrides:
toTag
in classLockableContainerBlockEntity
-
getInvStackList
- Specified by:
getInvStackList
in classLootableContainerBlockEntity
-
setInvStackList
- Specified by:
setInvStackList
in classLootableContainerBlockEntity
-
createScreenHandler
- Specified by:
createScreenHandler
in classLockableContainerBlockEntity
-