Class ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name named net/minecraft/block/entity/ChiseledBookshelfBlockEntity
intermediary net/minecraft/class_7716
official dqq
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.entity.BlockEntity
BlockEntity.ComponentsAccess
-
Field Summary
Modifier and TypeFieldDescriptionprivate final DefaultedList
<ItemStack> private int
private static final Logger
static final int
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
Fields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addComponents
(ComponentMap.Builder componentMapBuilder) boolean
canPlayerUse
(PlayerEntity player) Returns whetherplayer
can use this inventory.boolean
canTransferTo
(Inventory hopperInventory, int slot, ItemStack stack) Returns whether a hopper can transferstack
fromslot
to the hopper.void
clear()
int
int
int
Returns the maximum number of items a stack can contain when placed inside this inventory.getStack
(int slot) Returns the stack currently stored atslot
.boolean
isEmpty()
Returns whether the inventory consists entirely of empty item stacks.boolean
Returns whetherstack
is valid for theslot
.protected void
readComponents
(BlockEntity.ComponentsAccess components) protected void
readNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Reads data fromnbt
.void
removeStack
(int slot) Removes the stack currently stored atslot
.removeStack
(int slot, int amount) Removes a specific number of items fromslot
.void
Sets the stack stored atslot
tostack
.int
size()
Returns the size of the inventory.private void
updateState
(int interactedSlot) protected void
writeNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createComponentlessNbt, createComponentlessNbtWithIdentifyingData, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getComponents, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, setCachedState, setComponents, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, tryParseCustomName, writeIdToNbt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
containsAny, containsAny, count, getMaxCount, markDirty, onClose, onOpen
-
Field Details
-
MAX_BOOKS
public static final int MAX_BOOKS- See Also:
- Mappings:
Namespace Name Mixin selector named MAX_BOOKS
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;MAX_BOOKS:I
intermediary field_40331
Lnet/minecraft/class_7716;field_40331:I
official b
Ldqq;b:I
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGER
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;LOGGER:Lorg/slf4j/Logger;
intermediary field_40898
Lnet/minecraft/class_7716;field_40898:Lorg/slf4j/Logger;
official c
Ldqq;c:Lorg/slf4j/Logger;
-
inventory
- Mappings:
Namespace Name Mixin selector named inventory
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;inventory:Lnet/minecraft/util/collection/DefaultedList;
intermediary field_41314
Lnet/minecraft/class_7716;field_41314:Lnet/minecraft/class_2371;
official d
Ldqq;d:Ljv;
-
lastInteractedSlot
private int lastInteractedSlot- Mappings:
Namespace Name Mixin selector named lastInteractedSlot
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;lastInteractedSlot:I
intermediary field_41601
Lnet/minecraft/class_7716;field_41601:I
official e
Ldqq;e:I
-
-
Constructor Details
-
ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary <init>
Lnet/minecraft/class_7716;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official <init>
Ldqq;<init>(Ljd;Ldtc;)V
-
-
Method Details
-
updateState
private void updateState(int interactedSlot) - Mappings:
Namespace Name Mixin selector named updateState
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;updateState(I)V
intermediary method_47585
Lnet/minecraft/class_7716;method_47585(I)V
official c
Ldqq;c(I)V
-
readNbt
Reads data fromnbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
nbt
might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Overrides:
readNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named readNbt
Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11014
Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official a
Ldqh;a(Lub;Ljo$a;)V
-
writeNbt
Writes data tonbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
- Overrides:
writeNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbt
Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11007
Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official b
Ldqh;b(Lub;Ljo$a;)V
-
getFilledSlotCount
public int getFilledSlotCount()- Mappings:
Namespace Name Mixin selector named getFilledSlotCount
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getFilledSlotCount()I
intermediary method_47587
Lnet/minecraft/class_7716;method_47587()I
official f
Ldqq;f()I
-
clear
public void clear() -
size
public int size()Returns the size of the inventory.The inventory should support the slot ID from
0
tosize() - 1
. This should remain constant throughout the inventory's lifetime. -
isEmpty
public boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmpty
in interfaceInventory
- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector named isEmpty
Lnet/minecraft/inventory/Inventory;isEmpty()Z
intermediary method_5442
Lnet/minecraft/class_1263;method_5442()Z
official c
Lbqk;c()Z
-
getStack
Returns the stack currently stored atslot
.If the slot is empty, or is outside the bounds of this inventory, this returns
ItemStack.EMPTY
.- Specified by:
getStack
in interfaceInventory
- Returns:
- the stack currently stored at
slot
- Mappings:
Namespace Name Mixin selector named getStack
Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
intermediary method_5438
Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
official a
Lbqk;a(I)Lcuq;
-
removeStack
Removes a specific number of items fromslot
.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
intermediary method_5434
Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
official a
Lbqk;a(II)Lcuq;
-
removeStack
Removes the stack currently stored atslot
.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
intermediary method_5441
Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
official b
Lbqk;b(I)Lcuq;
-
setStack
Sets the stack stored atslot
tostack
. -
canTransferTo
Returns whether a hopper can transferstack
fromslot
to the hopper.This returns
true
by default.- Specified by:
canTransferTo
in interfaceInventory
- Returns:
- whether a hopper can transfer
stack
fromslot
to the hopper - Mappings:
Namespace Name Mixin selector named canTransferTo
Lnet/minecraft/inventory/Inventory;canTransferTo(Lnet/minecraft/inventory/Inventory;ILnet/minecraft/item/ItemStack;)Z
intermediary method_49104
Lnet/minecraft/class_1263;method_49104(Lnet/minecraft/class_1263;ILnet/minecraft/class_1799;)Z
official a
Lbqk;a(Lbqk;ILcuq;)Z
-
getMaxCountPerStack
public int getMaxCountPerStack()Returns the maximum number of items a stack can contain when placed inside this inventory.No slots may have more than this number of items. It is effectively the stacking limit for this inventory's slots.
- Specified by:
getMaxCountPerStack
in interfaceInventory
- Returns:
- the maximum number of items a stack can contain when placed inside this inventory
- Mappings:
Namespace Name Mixin selector named getMaxCountPerStack
Lnet/minecraft/inventory/Inventory;getMaxCountPerStack()I
intermediary method_5444
Lnet/minecraft/class_1263;method_5444()I
official al_
Lbqk;al_()I
-
canPlayerUse
Returns whetherplayer
can use this inventory.This is called by
ScreenHandler.canUse(net.minecraft.screen.ScreenHandlerContext, net.minecraft.entity.player.PlayerEntity, net.minecraft.block.Block)
.- Specified by:
canPlayerUse
in interfaceInventory
- Returns:
- whether
player
can use this inventory - See Also:
- API Note:
- Implementations should check the distance between the inventory
holder and
player
. For convenience, this interface offers two methods used by block entities to implement this check. - Mappings:
Namespace Name Mixin selector named canPlayerUse
Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
intermediary method_5443
Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
official a
Lbqk;a(Lcmx;)Z
-
isValid
Returns whetherstack
is valid for theslot
.Implementations can, for example, use this to check whether the item is in a specific tag. This returns
true
by default.- Specified by:
isValid
in interfaceInventory
- Returns:
- whether
stack
is valid for theslot
- Mappings:
Namespace Name Mixin selector named isValid
Lnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Z
intermediary method_5437
Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Z
official b
Lbqk;b(ILcuq;)Z
-
getLastInteractedSlot
public int getLastInteractedSlot()- Mappings:
Namespace Name Mixin selector named getLastInteractedSlot
Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getLastInteractedSlot()I
intermediary method_47887
Lnet/minecraft/class_7716;method_47887()I
official j
Ldqq;j()I
-
readComponents
- Overrides:
readComponents
in classBlockEntity
- Mappings:
Namespace Name Mixin selector named readComponents
Lnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/block/entity/BlockEntity$ComponentsAccess;)V
intermediary method_57568
Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_2586$class_9473;)V
official a
Ldqh;a(Ldqh$b;)V
-
addComponents
- Overrides:
addComponents
in classBlockEntity
- Mappings:
Namespace Name Mixin selector named addComponents
Lnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)V
intermediary method_57567
Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)V
official a
Ldqh;a(Lkm$a;)V
-
removeFromCopiedStackNbt
- Overrides:
removeFromCopiedStackNbt
in classBlockEntity
- Mappings:
Namespace Name Mixin selector named removeFromCopiedStackNbt
Lnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)V
intermediary method_57569
Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)V
official a
Ldqh;a(Lub;)V
-