Class ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name named net/minecraft/block/entity/ChiseledBookshelfBlockEntityintermediary net/minecraft/class_7716official duj
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.entity.BlockEntity
BlockEntity.ComponentsAccess -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack> private intprivate static final Loggerstatic final intFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, worldFields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponents(ComponentMap.Builder builder) booleancanPlayerUse(PlayerEntity player) Returns whetherplayercan use this inventory.booleancanTransferTo(Inventory hopperInventory, int slot, ItemStack stack) Returns whether a hopper can transferstackfromslotto the hopper.voidclear()intintintReturns the maximum number of items a stack can contain when placed inside this inventory.getStack(int slot) Returns the stack currently stored atslot.booleanisEmpty()Returns whether the inventory consists entirely of empty item stacks.booleanReturns whetherstackis valid for theslot.protected voidreadComponents(BlockEntity.ComponentsAccess components) protected voidreadNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Reads data fromnbt.voidremoveStack(int slot) Removes the stack currently stored atslot.removeStack(int slot, int amount) Removes a specific number of items fromslot.voidSets the stack stored atslottostack.intsize()Returns the size of the inventory.private voidupdateState(int interactedSlot) protected voidwriteNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Writes data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, 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, setWorld, supports, toInitialChunkDataNbt, toUpdatePacket, tryParseCustomName, writeIdToNbtMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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_BOOKSLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;MAX_BOOKS:Iintermediary field_40331Lnet/minecraft/class_7716;field_40331:Iofficial bLduj;b:I
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;LOGGER:Lorg/slf4j/Logger;intermediary field_40898Lnet/minecraft/class_7716;field_40898:Lorg/slf4j/Logger;official cLduj;c:Lorg/slf4j/Logger;
-
inventory
- Mappings:
Namespace Name Mixin selector named inventoryLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;inventory:Lnet/minecraft/util/collection/DefaultedList;intermediary field_41314Lnet/minecraft/class_7716;field_41314:Lnet/minecraft/class_2371;official dLduj;d:Lka;
-
lastInteractedSlot
private int lastInteractedSlot- Mappings:
Namespace Name Mixin selector named lastInteractedSlotLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;lastInteractedSlot:Iintermediary field_41601Lnet/minecraft/class_7716;field_41601:Iofficial eLduj;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;)Vintermediary <init>Lnet/minecraft/class_7716;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Lduj;<init>(Lji;Ldwy;)V
-
-
Method Details
-
updateState
private void updateState(int interactedSlot) - Mappings:
Namespace Name Mixin selector named updateStateLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;updateState(I)Vintermediary method_47585Lnet/minecraft/class_7716;method_47585(I)Vofficial cLduj;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.
nbtmight 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:
readNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial aLdua;a(Ltq;Ljt$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:
writeNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial bLdua;b(Ltq;Ljt$a;)V
-
getFilledSlotCount
public int getFilledSlotCount()- Mappings:
Namespace Name Mixin selector named getFilledSlotCountLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getFilledSlotCount()Iintermediary method_47587Lnet/minecraft/class_7716;method_47587()Iofficial fLduj;f()I
-
clear
public void clear() -
size
public int size()Returns the size of the inventory.The inventory should support the slot ID from
0tosize() - 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:
isEmptyin interfaceInventory- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector named isEmptyLnet/minecraft/inventory/Inventory;isEmpty()Zintermediary method_5442Lnet/minecraft/class_1263;method_5442()Zofficial cLbse;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:
getStackin interfaceInventory- Returns:
- the stack currently stored at
slot - Mappings:
Namespace Name Mixin selector named getStackLnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5438Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;official aLbse;a(I)Lcwq;
-
removeStack
Removes a specific number of items fromslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;intermediary method_5434Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;official aLbse;a(II)Lcwq;
-
removeStack
Removes the stack currently stored atslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;official bLbse;b(I)Lcwq;
-
setStack
Sets the stack stored atslottostack. -
canTransferTo
Returns whether a hopper can transferstackfromslotto the hopper.This returns
trueby default.- Specified by:
canTransferToin interfaceInventory- Returns:
- whether a hopper can transfer
stackfromslotto the hopper - Mappings:
Namespace Name Mixin selector named canTransferToLnet/minecraft/inventory/Inventory;canTransferTo(Lnet/minecraft/inventory/Inventory;ILnet/minecraft/item/ItemStack;)Zintermediary method_49104Lnet/minecraft/class_1263;method_49104(Lnet/minecraft/class_1263;ILnet/minecraft/class_1799;)Zofficial aLbse;a(Lbse;ILcwq;)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:
getMaxCountPerStackin interfaceInventory- Returns:
- the maximum number of items a stack can contain when placed inside this inventory
- Mappings:
Namespace Name Mixin selector named getMaxCountPerStackLnet/minecraft/inventory/Inventory;getMaxCountPerStack()Iintermediary method_5444Lnet/minecraft/class_1263;method_5444()Iofficial an_Lbse;an_()I
-
canPlayerUse
Returns whetherplayercan use this inventory.This is called by
ScreenHandler.canUse(net.minecraft.screen.ScreenHandlerContext, net.minecraft.entity.player.PlayerEntity, net.minecraft.block.Block).- Specified by:
canPlayerUsein interfaceInventory- Returns:
- whether
playercan 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 canPlayerUseLnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_5443Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Zofficial aLbse;a(Lcoy;)Z
-
isValid
Returns whetherstackis valid for theslot.Implementations can, for example, use this to check whether the item is in a specific tag. This returns
trueby default.- Specified by:
isValidin interfaceInventory- Returns:
- whether
stackis valid for theslot - Mappings:
Namespace Name Mixin selector named isValidLnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Zintermediary method_5437Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Zofficial bLbse;b(ILcwq;)Z
-
getLastInteractedSlot
public int getLastInteractedSlot()- Mappings:
Namespace Name Mixin selector named getLastInteractedSlotLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getLastInteractedSlot()Iintermediary method_47887Lnet/minecraft/class_7716;method_47887()Iofficial jLduj;j()I
-
readComponents
- Overrides:
readComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector named readComponentsLnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/block/entity/BlockEntity$ComponentsAccess;)Vintermediary method_57568Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_2586$class_9473;)Vofficial aLdua;a(Ldua$b;)V
-
addComponents
- Overrides:
addComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector named addComponentsLnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)Vintermediary method_57567Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)Vofficial aLdua;a(Lkr$a;)V
-
removeFromCopiedStackNbt
- Overrides:
removeFromCopiedStackNbtin classBlockEntity- Mappings:
Namespace Name Mixin selector named removeFromCopiedStackNbtLnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)Vintermediary method_57569Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)Vofficial aLdua;a(Ltq;)V
-