Class ChiseledBookShelfBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity
- All Implemented Interfaces:
Clearable,Container,IAttachmentHolder,IBlockEntityExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInputNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NonNullList<ItemStack> private intprivate static final org.slf4j.Loggerstatic final intFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleancanPlaceItem(int p_256567_, ItemStack p_255922_) Returnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot.booleancanTakeItem(Container p_282172_, int p_281387_, ItemStack p_283257_) Returnstrueif the given stack can be extracted into the target inventory.voidprotected voidintcount()intgetItem(int p_256203_) Returns the stack in the given slot.intintbooleanisEmpty()protected voidloadAdditional(CompoundTag p_338883_, HolderLookup.Provider p_338454_) voidremoveComponentsFromTag(CompoundTag p_332725_) removeItem(int p_255828_, int p_255673_) Removes up to a specified number of items from an inventory slot and returns them in a new stack.removeItemNoUpdate(int p_255874_) Removes a stack from the given slot and returns it.protected voidsaveAdditional(CompoundTag p_251872_, HolderLookup.Provider p_323649_) voidSets the given item stack to the specified slot in the inventory (can be crafting or armor sections).booleanstillValid(Player p_256481_) Don't rename this method to canInteractWith due to conflicts with Containerprivate voidupdateState(int pSlot) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, removeData, saveCustomAndMetadata, saveCustomOnly, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpenMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
Field Details
-
MAX_BOOKS_IN_STORAGE
public static final int MAX_BOOKS_IN_STORAGE- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
items
-
lastInteractedSlot
private int lastInteractedSlot
-
-
Constructor Details
-
ChiseledBookShelfBlockEntity
-
-
Method Details
-
updateState
private void updateState(int pSlot) -
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
count
public int count() -
clearContent
public void clearContent()- Specified by:
clearContentin interfaceClearable
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
isEmpty
public boolean isEmpty() -
getItem
Description copied from interface:ContainerReturns the stack in the given slot. -
removeItem
Description copied from interface:ContainerRemoves up to a specified number of items from an inventory slot and returns them in a new stack.- Specified by:
removeItemin interfaceContainer
-
removeItemNoUpdate
Description copied from interface:ContainerRemoves a stack from the given slot and returns it.- Specified by:
removeItemNoUpdatein interfaceContainer
-
setItem
Description copied from interface:ContainerSets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -
canTakeItem
Description copied from interface:ContainerReturnstrueif the given stack can be extracted into the target inventory.- Specified by:
canTakeItemin interfaceContainer- Parameters:
p_282172_- the container into which the item should be extractedp_281387_- the slot from which to extract the itemp_283257_- the item to extract- Returns:
trueif the given stack can be extracted into the target inventory
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfaceContainer
-
stillValid
Description copied from interface:ContainerDon't rename this method to canInteractWith due to conflicts with Container- Specified by:
stillValidin interfaceContainer
-
canPlaceItem
Description copied from interface:ContainerReturnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid- Specified by:
canPlaceItemin interfaceContainer
-
getLastInteractedSlot
public int getLastInteractedSlot() -
applyImplicitComponents
- Overrides:
applyImplicitComponentsin classBlockEntity
-
collectImplicitComponents
- Overrides:
collectImplicitComponentsin classBlockEntity
-
removeComponentsFromTag
- Overrides:
removeComponentsFromTagin classBlockEntity
-