Class ShelfBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.ShelfBlockEntity
- All Implemented Interfaces:
Iterable<ItemStack>, TypedInstance<BlockEntityType<?>>, DebugValueSource, Clearable, Container, ItemOwner, SlotProvider, ListBackedContainer, IAttachmentHolder, ContainerExtension, IBlockEntityExtension
-
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>Nested classes/interfaces inherited from interface ItemOwner
ItemOwner.OffsetFromOwner -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate booleanprivate final NonNullList<ItemStack> private static final org.slf4j.Loggerstatic final intFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyImplicitComponents(DataComponentGetter components) protected voidcollectImplicitComponents(DataComponentMap.Builder components) booleangetItems()getUpdateTag(HolderLookup.Provider registries) floatlevel()protected voidloadAdditional(ValueInput input) position()voidremoveComponentsFromTag(ValueOutput output) protected voidsaveAdditional(ValueOutput output) voidvoidsetChanged(@Nullable Holder.Reference<GameEvent> event) voidSets the given item stack to the specified slot in the inventory (can be crafting or armor sections).voidAn extension ofContainer.setItem(int, ItemStack)that allows non-transactional side-effects to be skipped.booleanstillValid(Player player) Don't rename this method to canInteractWith due to conflicts with ContainerswapItemNoUpdate(int slot, ItemStack heldItemStack) Methods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, 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 Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, startOpen, stopOpenMethods inherited from interface ContainerExtension
onTransferMethods 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 ItemOwner
asLivingEntityMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface ListBackedContainer
acceptsItemType, canPlaceItem, clearContent, count, getContainerSize, getItem, isEmpty, removeItem, removeItemNoUpdate, setItemNoUpdateMethods inherited from interface SlotProvider
getSlotsFromRange
-
Field Details
-
MAX_ITEMS
public static final int MAX_ITEMS- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ALIGN_ITEMS_TO_BOTTOM_TAG
- See Also:
-
items
-
alignItemsToBottom
private boolean alignItemsToBottom
-
-
Constructor Details
-
ShelfBlockEntity
-
-
Method Details
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
getUpdatePacket
- Overrides:
getUpdatePacketin classBlockEntity
-
getUpdateTag
- Overrides:
getUpdateTagin classBlockEntity
-
getItems
- Specified by:
getItemsin interfaceListBackedContainer
-
stillValid
Description copied from interface:ContainerDon't rename this method to canInteractWith due to conflicts with Container- Specified by:
stillValidin interfaceContainer
-
swapItemNoUpdate
-
setItem
-
setItem
Description copied from interface:ContainerExtensionAn extension ofContainer.setItem(int, ItemStack)that allows non-transactional side-effects to be skipped. Non-transactional side-effects include for example callingsetChangedor making changes to the world.- Specified by:
setItemin interfaceContainerExtension- Parameters:
insideTransaction- Whentrue, non-transactional actions should be deferred. Whenfalse, non-transactional actions can be performed immediately.- See Also:
-
setChanged
-
setChanged
public void setChanged()- Specified by:
setChangedin interfaceContainer- Overrides:
setChangedin classBlockEntity
-
applyImplicitComponents
- Overrides:
applyImplicitComponentsin classBlockEntity
-
collectImplicitComponents
- Overrides:
collectImplicitComponentsin classBlockEntity
-
removeComponentsFromTag
- Overrides:
removeComponentsFromTagin classBlockEntity
-
level
-
position
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Specified by:
getVisualRotationYInDegreesin interfaceItemOwner
-
getAlignItemsToBottom
public boolean getAlignItemsToBottom()
-