Package net.minecraft.block.entity
Class BarrelBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LockableContainerBlockEntity
net.minecraft.block.entity.LootableContainerBlockEntity
net.minecraft.block.entity.BarrelBlockEntity
- All Implemented Interfaces:
Inventory,NamedScreenHandlerFactory,ScreenHandlerFactory,Clearable,Nameable
public class BarrelBlockEntity extends LootableContainerBlockEntity
-
Field Summary
Fields Modifier and Type Field Description private DefaultedList<ItemStack>inventoryprivate ChestStateManagerstateManagerFields inherited from class net.minecraft.block.entity.LootableContainerBlockEntity
lootTableId, lootTableSeedFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors Constructor Description BarrelBlockEntity(BlockPos pos, BlockState state) -
Method Summary
Modifier and Type Method Description protected ScreenHandlercreateScreenHandler(int syncId, PlayerInventory playerInventory)voidfromTag(CompoundTag tag)protected TextgetContainerName()protected DefaultedList<ItemStack>getInvStackList()voidonClose(PlayerEntity player)voidonOpen(PlayerEntity player)private voidplaySound(BlockState state, SoundEvent soundEvent)protected voidsetInvStackList(DefaultedList<ItemStack> list)private voidsetOpen(BlockState state, boolean open)intsize()voidtick()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, markDirtyMethods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
inventory
-
stateManager
-
-
Constructor Details
-
BarrelBlockEntity
-
-
Method Details
-
toTag
- Overrides:
toTagin classLockableContainerBlockEntity
-
fromTag
- Overrides:
fromTagin classLockableContainerBlockEntity
-
size
public int size() -
getInvStackList
- Specified by:
getInvStackListin classLootableContainerBlockEntity
-
setInvStackList
- Specified by:
setInvStackListin classLootableContainerBlockEntity
-
getContainerName
- Specified by:
getContainerNamein classLockableContainerBlockEntity
-
createScreenHandler
- Specified by:
createScreenHandlerin classLockableContainerBlockEntity
-
onOpen
-
onClose
-
tick
public void tick() -
setOpen
-
playSound
-