Class ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name official dheintermediary net/minecraft/class_7716named net/minecraft/block/entity/ChiseledBookshelfBlockEntity
-
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
field_42619, MAX_COUNT_PER_STACK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlayerUse(PlayerEntity player) Returns whetherplayercan use this inventory.booleancanTransferTo(Inventory hopperInventory, int slot, ItemStack stack) Returns whether a hopper can transferstackfromslotto the hopper.voidclear()intintReturns the maximum number of items a stack can contain when placed inside this inventory.intgetStack(int slot) Returns the stack currently stored atslot.booleanisEmpty()Returns whether the inventory consists entirely of empty item stacks.booleanReturns whetherstackis valid for theslot.voidreadNbt(NbtCompound nbt) Reads data fromnbt.removeStack(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) Writes data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, 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, markDirty, onClose, onOpen
-
Field Details
-
MAX_BOOKS
public static final int MAX_BOOKS- See Also:
- Mappings:
Namespace Name Mixin selector official cLdhe;c:Iintermediary field_40331Lnet/minecraft/class_7716;field_40331:Inamed MAX_BOOKSLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;MAX_BOOKS:I
-
LOGGER
- Mappings:
Namespace Name Mixin selector official dLdhe;d:Lorg/slf4j/Logger;intermediary field_40898Lnet/minecraft/class_7716;field_40898:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;LOGGER:Lorg/slf4j/Logger;
-
inventory
- Mappings:
Namespace Name Mixin selector official eLdhe;e:Liq;intermediary field_41314Lnet/minecraft/class_7716;field_41314:Lnet/minecraft/class_2371;named inventoryLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;inventory:Lnet/minecraft/util/collection/DefaultedList;
-
lastInteractedSlot
private int lastInteractedSlot- Mappings:
Namespace Name Mixin selector official fLdhe;f:Iintermediary field_41601Lnet/minecraft/class_7716;field_41601:Inamed lastInteractedSlotLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;lastInteractedSlot:I
-
-
Constructor Details
-
ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>Ldhe;<init>(Lhx;Ldjh;)Vintermediary <init>Lnet/minecraft/class_7716;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed <init>Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
-
Method Details
-
updateState
private void updateState(int interactedSlot) - Mappings:
Namespace Name Mixin selector official cLdhe;c(I)Vintermediary method_47585Lnet/minecraft/class_7716;method_47585(I)Vnamed updateStateLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;updateState(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 official aLdgv;a(Lsn;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)Vnamed readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)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 official bLdgv;b(Lsn;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)Vnamed writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
getOpenSlotCount
public int getOpenSlotCount()- Mappings:
Namespace Name Mixin selector official fLdhe;f()Iintermediary method_47587Lnet/minecraft/class_7716;method_47587()Inamed getOpenSlotCountLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getOpenSlotCount()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 official ai_Lbju;ai_()Zintermediary method_5442Lnet/minecraft/class_1263;method_5442()Znamed isEmptyLnet/minecraft/inventory/Inventory;isEmpty()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 official aLbju;a(I)Lcmy;intermediary method_5438Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;named getStackLnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
-
removeStack
Removes a specific number of items fromslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official aLbju;a(II)Lcmy;intermediary method_5434Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
-
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 official bLbju;b(I)Lcmy;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-
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 official aLbju;a(Lbju;ILcmy;)Zintermediary method_49104Lnet/minecraft/class_1263;method_49104(Lnet/minecraft/class_1263;ILnet/minecraft/class_1799;)Znamed canTransferToLnet/minecraft/inventory/Inventory;canTransferTo(Lnet/minecraft/inventory/Inventory;ILnet/minecraft/item/ItemStack;)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 official ak_Lbju;ak_()Iintermediary method_5444Lnet/minecraft/class_1263;method_5444()Inamed getMaxCountPerStackLnet/minecraft/inventory/Inventory;getMaxCountPerStack()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:
- Mappings:
Namespace Name Mixin selector official aLbju;a(Lcfi;)Zintermediary method_5443Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Znamed canPlayerUseLnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)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 official bLbju;b(ILcmy;)Zintermediary method_5437Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Znamed isValidLnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Z
-
getLastInteractedSlot
public int getLastInteractedSlot()- Mappings:
Namespace Name Mixin selector official gLdhe;g()Iintermediary method_47887Lnet/minecraft/class_7716;method_47887()Inamed getLastInteractedSlotLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getLastInteractedSlot()I
-