Class ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name official cvzintermediary net/minecraft/class_7716named net/minecraft/block/entity/ChiseledBookshelfBlockEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final class_7865private 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(class_7865 class_7865) 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()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.booleanprivate voidvoidreadNbt(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()Returns the serialized state of this block entity that is observable by clients.Returns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.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, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, writeIdToNbt
-
Field Details
-
field_40898
- Mappings:
Namespace Name Mixin selector official cLcvz;c:Lorg/slf4j/Logger;intermediary field_40898Lnet/minecraft/class_7716;field_40898:Lorg/slf4j/Logger;named field_40898Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;field_40898:Lorg/slf4j/Logger;
-
MAX_BOOKS
public static final int MAX_BOOKS- See Also:
- Mappings:
Namespace Name Mixin selector official bLcvz;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 dLcvz;d:Lcei;intermediary field_40332Lnet/minecraft/class_7716;field_40332:Lnet/minecraft/class_7865;named booksLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;books:Lnet/minecraft/class_7865;
-
-
Constructor Details
-
ChiseledBookshelfBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>Lcvz;<init>(Lgo;Lcya;)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
-
method_46693
private void method_46693()- Mappings:
Namespace Name Mixin selector official wLcvz;w()Vintermediary method_46693Lnet/minecraft/class_7716;method_46693()Vnamed method_46693Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;method_46693()V
-
getLastBook
- Mappings:
Namespace Name Mixin selector official fLcvz;f()Lcdb;intermediary method_45464Lnet/minecraft/class_7716;method_45464()Lnet/minecraft/class_1799;named getLastBookLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getLastBook()Lnet/minecraft/item/ItemStack;
-
method_46692
- Mappings:
Namespace Name Mixin selector official gLcvz;g()Ljava/util/List;intermediary method_46692Lnet/minecraft/class_7716;method_46692()Ljava/util/List;named method_46692Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;method_46692()Ljava/util/List;
-
addBook
- Mappings:
Namespace Name Mixin selector official aLcvz;a(Lcdb;)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 aLcvs;a(Lqi;)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 bLcvs;b(Lqi;)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 aLcvz;a(Lcei;)Lhg;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/class_7865;)Lnet/minecraft/util/collection/DefaultedList;
-
toUpdatePacket
Description copied from class:BlockEntityReturns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.If the data returned by
initial chunk datais suitable for updates, the following shortcut can be used to create an update packet:BlockEntityUpdateS2CPacket.create(this). The NBT will be passed toBlockEntity.readNbt(net.minecraft.nbt.NbtCompound)on the client."Observable state" is a state that clients can observe without specific interaction. For example,
CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.To sync block entity data using this method, use
serverWorld.getChunkManager().markForUpdate(this.getPos());.- Overrides:
toUpdatePacketin classBlockEntity- Returns:
- the packet to send to nearby players when the block entity's observable
state changes, or
nullto not send the packet - See Also:
- Mappings:
Namespace Name Mixin selector official iLcvz;i()Lul;intermediary method_45465Lnet/minecraft/class_7716;method_45465()Lnet/minecraft/class_2622;named toUpdatePacketLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
-
toInitialChunkDataNbt
Returns the serialized state of this block entity that is observable by clients.This is sent alongside the initial chunk data, as well as when the block entity implements
BlockEntity.toUpdatePacket()and decides to use the defaultBlockEntityUpdateS2CPacket."Observable state" is a state that clients can observe without specific interaction. For example,
CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.To send all NBT data of this block entity saved to disk, return
BlockEntity.createNbt().- Overrides:
toInitialChunkDataNbtin classBlockEntity- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector official ac_Lcvs;ac_()Lqi;intermediary method_16887Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
-
clear
public void clear() -
getBookCount
public int getBookCount()- Mappings:
Namespace Name Mixin selector official jLcvz;j()Iintermediary method_45466Lnet/minecraft/class_7716;method_45466()Inamed getBookCountLnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getBookCount()I
-
method_45468
public boolean method_45468()- Mappings:
Namespace Name Mixin selector official tLcvz;t()Zintermediary method_45468Lnet/minecraft/class_7716;method_45468()Znamed method_45468Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;method_45468()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 eLcvs;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 aLbbr;a(II)Lcdb;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 bLbbr;b(I)Lcdb;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 Q_Lbbr;Q_()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 aLbbr;a(Lbvx;)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 aLbbr;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_Lbbr;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
-