Class ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name official cwhintermediary net/minecraft/class_7716named net/minecraft/block/entity/ChiseledBookshelfBlockEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StackMappingInventoryprivate static final Loggerstatic final intFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, worldFields inherited from interface net.minecraft.inventory.Inventory
MAX_COUNT_PER_STACK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanPlayerUse(PlayerEntity player) voidclear()booleancontainsAny(Predicate<ItemStack> predicate) booleancontainsAny(Set<Item> items) Determines whether this inventory contains any of the given candidate items.intReturns the number of times the specified item occurs in this inventory across all stored stacks.intprivate static DefaultedList<ItemStack>getBooksAsList(StackMappingInventory inventory) intReturns the maximum number of items a stack can contain when placed inside this inventory.getStack(int slot) Fetches the stack currently stored at the given slot.booleanisEmpty()booleanisFull()booleanReturns whether the given stack is a valid for the indicated slot position.voidMarks this block entity as dirty and that it needs to be saved.voidreadNbt(NbtCompound nbt) Reads data fromnbt.removeStack(int slot) Removes the stack currently stored at the indicated slot.removeStack(int slot, int amount) Removes a specific number of items from the given slot.voidintsize()private voidprotected 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, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, writeIdToNbt
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official cLcwh;c:Lorg/slf4j/Logger;intermediary field_40898Lnet/minecraft/class_7716;field_40898:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;LOGGER:Lorg/slf4j/Logger;
-
MAX_BOOKS
public static final int MAX_BOOKS- See Also:
- Mappings:
Namespace Name Mixin selector official bLcwh;b:Iintermediary field_40331Lnet/minecraft/class_7716;field_40331:Inamed MAX_BOOKSLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;MAX_BOOKS:I
-
books
- Mappings:
Namespace Name Mixin selector official dLcwh;d:Lcep;intermediary field_40332Lnet/minecraft/class_7716;field_40332:Lnet/minecraft/class_7865;named booksLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;books:Lnet/minecraft/inventory/StackMappingInventory;
-
-
Constructor Details
-
ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>Lcwh;<init>(Lgp;Lcyi;)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()- Mappings:
Namespace Name Mixin selector official tLcwh;t()Vintermediary method_46693Lnet/minecraft/class_7716;method_46693()Vnamed updateStateLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;updateState()V
-
getLastBook
- Mappings:
Namespace Name Mixin selector official fLcwh;f()Lcdi;intermediary method_45464Lnet/minecraft/class_7716;method_45464()Lnet/minecraft/class_1799;named getLastBookLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getLastBook()Lnet/minecraft/item/ItemStack;
-
getAndClearBooks
- Mappings:
Namespace Name Mixin selector official gLcwh;g()Ljava/util/List;intermediary method_46692Lnet/minecraft/class_7716;method_46692()Ljava/util/List;named getAndClearBooksLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getAndClearBooks()Ljava/util/List;
-
addBook
- Mappings:
Namespace Name Mixin selector official aLcwh;a(Lcdi;)Zintermediary method_45462Lnet/minecraft/class_7716;method_45462(Lnet/minecraft/class_1799;)Znamed addBookLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;addBook(Lnet/minecraft/item/ItemStack;)Z
-
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 aLcwa;a(Lqn;)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 bLcwa;b(Lqn;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)Vnamed writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
getBooksAsList
- Mappings:
Namespace Name Mixin selector official aLcwh;a(Lcep;)Lhi;intermediary method_45463Lnet/minecraft/class_7716;method_45463(Lnet/minecraft/class_7865;)Lnet/minecraft/class_2371;named getBooksAsListLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getBooksAsList(Lnet/minecraft/inventory/StackMappingInventory;)Lnet/minecraft/util/collection/DefaultedList;
-
clear
public void clear() -
getBookCount
public int getBookCount()- Mappings:
Namespace Name Mixin selector official iLcwh;i()Iintermediary method_45466Lnet/minecraft/class_7716;method_45466()Inamed getBookCountLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getBookCount()I
-
isFull
public boolean isFull()- Mappings:
Namespace Name Mixin selector official jLcwh;j()Zintermediary method_45468Lnet/minecraft/class_7716;method_45468()Znamed isFullLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;isFull()Z
-
size
public int size() -
markDirty
public void markDirty()Marks this block entity as dirty and that it needs to be saved. This also triggers comparator update.This must be called when something changed in a way that affects the saved NBT; otherwise, the game might not save the block entity.
- Specified by:
markDirtyin interfaceInventory- Overrides:
markDirtyin classBlockEntity- Mappings:
Namespace Name Mixin selector official eLcwa;e()Vintermediary method_5431Lnet/minecraft/class_2586;method_5431()Vnamed markDirtyLnet/minecraft/block/entity/BlockEntity;markDirty()V
-
isEmpty
public boolean isEmpty() -
getStack
Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY. -
removeStack
Removes a specific number of items from the given slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official aLbbw;a(II)Lcdi;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 at the indicated slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot.
- Mappings:
Namespace Name Mixin selector official bLbbw;b(I)Lcdi;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
-
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 max
countof item stacks in this inventory - Mappings:
Namespace Name Mixin selector official P_Lbbw;P_()Iintermediary method_5444Lnet/minecraft/class_1263;method_5444()Inamed getMaxCountPerStackLnet/minecraft/inventory/Inventory;getMaxCountPerStack()I
-
canPlayerUse
- Specified by:
canPlayerUsein interfaceInventory- Mappings:
Namespace Name Mixin selector official aLbbw;a(Lbwe;)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 whether the given stack is a valid for the indicated slot position. -
count
Returns the number of times the specified item occurs in this inventory across all stored stacks. -
containsAny
Determines whether this inventory contains any of the given candidate items.- Specified by:
containsAnyin interfaceInventory- Mappings:
Namespace Name Mixin selector official aLbbw;a(Ljava/util/Set;)Zintermediary method_18862Lnet/minecraft/class_1263;method_18862(Ljava/util/Set;)Znamed containsAnyLnet/minecraft/inventory/Inventory;containsAny(Ljava/util/Set;)Z
-
containsAny
- Specified by:
containsAnyin interfaceInventory- Mappings:
Namespace Name Mixin selector official a_Lbbw;a_(Ljava/util/function/Predicate;)Zintermediary method_43256Lnet/minecraft/class_1263;method_43256(Ljava/util/function/Predicate;)Znamed containsAnyLnet/minecraft/inventory/Inventory;containsAny(Ljava/util/function/Predicate;)Z
-