Class BarrelBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
net.minecraft.world.level.block.entity.BarrelBlockEntity
- All Implemented Interfaces:
Iterable<ItemStack>, TypedInstance<BlockEntityType<?>>, DebugValueSource, Clearable, Container, SlotProvider, MenuConstructor, MenuProvider, Nameable, RandomizableContainer, IAttachmentHolder, ContainerExtension, IBlockEntityExtension, IMenuProviderExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface Container
Container.ContainerIteratorNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Componentprivate NonNullList<ItemStack> private final ContainerOpenersCounterFields inherited from class RandomizableContainerBlockEntity
lootTable, lootTableSeedFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface Container
DEFAULT_DISTANCE_BUFFERFields inherited from interface RandomizableContainer
LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractContainerMenucreateMenu(int containerId, Inventory inventory) intprotected Componentprotected NonNullList<ItemStack> getItems()protected voidloadAdditional(ValueInput input) private voidplaySound(BlockState state, SoundEvent event) voidprotected voidsaveAdditional(ValueOutput output) protected voidsetItems(NonNullList<ItemStack> items) voidstartOpen(ContainerUser containerUser) voidstopOpen(ContainerUser containerUser) private voidupdateBlockState(BlockState state, boolean isOpen) Methods inherited from class RandomizableContainerBlockEntity
applyImplicitComponents, canOpen, collectImplicitComponents, createMenu, getItem, getLootTable, getLootTableSeed, isEmpty, removeComponentsFromTag, removeItem, removeItemNoUpdate, setItem, setLootTable, setLootTableSeedMethods inherited from class BaseContainerBlockEntity
clearContent, getCustomName, getDisplayName, getName, isLocked, sendChestLockedNotifications, setItem, stillValidMethods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEvent, typeHolderMethods inherited from class AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Clearable
clearContentMethods inherited from interface Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, setChanged, stillValidMethods inherited from interface ContainerExtension
onTransfer, setItemMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdateMethods inherited from interface IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideDataMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Nameable
getPlainTextName, hasCustomNameMethods inherited from interface RandomizableContainer
getBlockPos, getLevel, setLootTable, tryLoadLootTable, trySaveLootTable, unpackLootTableMethods inherited from interface SlotProvider
getSlotsFromRange
-
Field Details
-
DEFAULT_NAME
-
items
-
openersCounter
-
-
Constructor Details
-
BarrelBlockEntity
-
-
Method Details
-
saveAdditional
- Overrides:
saveAdditionalin classBaseContainerBlockEntity
-
loadAdditional
- Overrides:
loadAdditionalin classBaseContainerBlockEntity
-
getContainerSize
public int getContainerSize() -
getItems
- Specified by:
getItemsin classBaseContainerBlockEntity
-
setItems
- Specified by:
setItemsin classBaseContainerBlockEntity
-
getDefaultName
- Specified by:
getDefaultNamein classBaseContainerBlockEntity
-
createMenu
- Specified by:
createMenuin classBaseContainerBlockEntity
-
startOpen
-
stopOpen
-
getEntitiesWithContainerOpen
-
recheckOpen
public void recheckOpen() -
updateBlockState
-
playSound
-