Class DispenserBlockEntity
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.DispenserBlockEntity
- All Implemented Interfaces:
Iterable<ItemStack>, TypedInstance<BlockEntityType<?>>, DebugValueSource, Clearable, Container, SlotProvider, MenuConstructor, MenuProvider, Nameable, RandomizableContainer, IAttachmentHolder, ContainerExtension, IBlockEntityExtension, IMenuProviderExtension
- Direct Known Subclasses:
DropperBlockEntity
-
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 TypeFieldDescriptionstatic final intprivate static final Componentprivate NonNullList<ItemStack> Fields 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
ConstructorsModifierConstructorDescriptionDispenserBlockEntity(BlockPos worldPosition, BlockState blockState) protectedDispenserBlockEntity(BlockEntityType<?> type, BlockPos worldPosition, BlockState blockState) -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractContainerMenucreateMenu(int containerId, Inventory inventory) intprotected Componentprotected NonNullList<ItemStack> getItems()intgetRandomSlot(RandomSource random) insertItem(ItemStack itemStack) protected voidloadAdditional(ValueInput input) protected voidsaveAdditional(ValueOutput output) protected voidsetItems(NonNullList<ItemStack> items) 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, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, setChanged, startOpen, stillValid, stopOpenMethods 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
-
CONTAINER_SIZE
public static final int CONTAINER_SIZE- See Also:
-
DEFAULT_NAME
-
items
-
-
Constructor Details
-
DispenserBlockEntity
protected DispenserBlockEntity(BlockEntityType<?> type, BlockPos worldPosition, BlockState blockState) -
DispenserBlockEntity
-
-
Method Details
-
getContainerSize
public int getContainerSize() -
getRandomSlot
-
insertItem
-
getDefaultName
- Specified by:
getDefaultNamein classBaseContainerBlockEntity
-
loadAdditional
- Overrides:
loadAdditionalin classBaseContainerBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBaseContainerBlockEntity
-
getItems
- Specified by:
getItemsin classBaseContainerBlockEntity
-
setItems
- Specified by:
setItemsin classBaseContainerBlockEntity
-
createMenu
- Specified by:
createMenuin classBaseContainerBlockEntity
-