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 intviewerCountFields 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 BarrelBlockEntity()privateBarrelBlockEntity(BlockEntityType<?> type) -
Method Summary
Modifier and Type Method Description protected ScreenHandlercreateScreenHandler(int syncId, PlayerInventory playerInventory)voidfromTag(BlockState state, CompoundTag tag)protected TextgetContainerName()protected DefaultedList<ItemStack>getInvStackList()voidonClose(PlayerEntity player)voidonOpen(PlayerEntity player)private voidplaySound(BlockState blockState, SoundEvent soundEvent)private voidscheduleUpdate()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
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, 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
-
viewerCount
private int viewerCount
-
-
Constructor Details
-
BarrelBlockEntity
-
BarrelBlockEntity
public 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
-
scheduleUpdate
private void scheduleUpdate() -
tick
public void tick() -
onClose
-
setOpen
-
playSound
-