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>inventoryprivate static RandomRANDOMFields inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
lootTableId, lootTableSeedFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors Modifier Constructor Description protectedDispenserBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState)DispenserBlockEntity(BlockPos blockPos, BlockState blockState) -
Method Summary
Modifier and Type Method Description intaddToFirstFreeSlot(ItemStack stack)intchooseNonEmptySlot()protected ScreenHandlercreateScreenHandler(int syncId, PlayerInventory playerInventory)voidfromTag(CompoundTag tag)protected TextgetContainerName()protected DefaultedList<ItemStack>getInvStackList()protected voidsetInvStackList(DefaultedList<ItemStack> list)intsize()CompoundTagtoTag(CompoundTag tag)Methods inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
canPlayerUse, checkLootInteraction, checkUnlocked, clear, createMenu, deserializeLootTable, getStack, isEmpty, removeStack, removeStack, serializeLootTable, setLootTable, setLootTable, setStackMethods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, getCustomName, getDisplayName, getName, setCustomNameMethods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, setCachedState, setWorld, toInitialChunkDataTag, toUpdatePacketMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
containsAny, count, getMaxCountPerStack, isValid, markDirty, onClose, onOpenMethods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
RANDOM
-
inventory
-
-
Constructor Details
-
DispenserBlockEntity
protected DispenserBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState) -
DispenserBlockEntity
-
-
Method Details
-
size
public int size() -
chooseNonEmptySlot
public int chooseNonEmptySlot() -
addToFirstFreeSlot
-
getContainerName
- Specified by:
getContainerNamein classLockableContainerBlockEntity
-
fromTag
- Overrides:
fromTagin classLockableContainerBlockEntity
-
toTag
- Overrides:
toTagin classLockableContainerBlockEntity
-
getInvStackList
- Specified by:
getInvStackListin classLootableContainerBlockEntity
-
setInvStackList
- Specified by:
setInvStackListin classLootableContainerBlockEntity
-
createScreenHandler
- Specified by:
createScreenHandlerin classLockableContainerBlockEntity
-