Class ChiseledBookshelfBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.ChiseledBookshelfBlockEntity
All Implemented Interfaces:
Clearable

public class ChiseledBookshelfBlockEntity extends BlockEntity implements Clearable
Mappings:
Namespace Name
official cvt
intermediary net/minecraft/class_7716
named net/minecraft/block/entity/ChiseledBookshelfBlockEntity
  • Field Details

    • MAX_BOOKS

      public static final int MAX_BOOKS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcvt;a:I
      intermediary field_40331 Lnet/minecraft/class_7716;field_40331:I
      named MAX_BOOKS Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;MAX_BOOKS:I
    • books

      private final Deque<ItemStack> books
      Mappings:
      Namespace Name Mixin selector
      official b Lcvt;b:Ljava/util/Deque;
      intermediary field_40332 Lnet/minecraft/class_7716;field_40332:Ljava/util/Deque;
      named books Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;books:Ljava/util/Deque;
  • Constructor Details

    • ChiseledBookshelfBlockEntity

      public ChiseledBookshelfBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcvt;<init>(Lgr;Lcxu;)V
      intermediary <init> Lnet/minecraft/class_7716;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
  • Method Details

    • getLastBook

      public ItemStack getLastBook()
      Mappings:
      Namespace Name Mixin selector
      official c Lcvt;c()Lccw;
      intermediary method_45464 Lnet/minecraft/class_7716;method_45464()Lnet/minecraft/class_1799;
      named getLastBook Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getLastBook()Lnet/minecraft/item/ItemStack;
    • addBook

      public void addBook(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvt;a(Lccw;)V
      intermediary method_45462 Lnet/minecraft/class_7716;method_45462(Lnet/minecraft/class_1799;)V
      named addBook Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;addBook(Lnet/minecraft/item/ItemStack;)V
    • readNbt

      public void readNbt(NbtCompound nbt)
      Reads data from nbt. 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 class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcvm;a(Lqf;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)V
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • writeNbt

      protected void writeNbt(NbtCompound nbt)
      Writes data to nbt. 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 class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lcvm;b(Lqf;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)V
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • getBooksAsList

      private static DefaultedList<ItemStack> getBooksAsList(Collection<ItemStack> books)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvt;a(Ljava/util/Collection;)Lhh;
      intermediary method_45463 Lnet/minecraft/class_7716;method_45463(Ljava/util/Collection;)Lnet/minecraft/class_2371;
      named getBooksAsList Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getBooksAsList(Ljava/util/Collection;)Lnet/minecraft/util/collection/DefaultedList;
    • method_45465

      public BlockEntityUpdateS2CPacket method_45465()
      Mappings:
      Namespace Name Mixin selector
      official d Lcvt;d()Lui;
      intermediary method_45465 Lnet/minecraft/class_7716;method_45465()Lnet/minecraft/class_2622;
      named method_45465 Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;method_45465()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
    • toInitialChunkDataNbt

      public NbtCompound 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 default BlockEntityUpdateS2CPacket.

      "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:
      toInitialChunkDataNbt in class BlockEntity
      Returns:
      the serialized state of this block entity that is observable by clients
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official ac_ Lcvm;ac_()Lqf;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
    • clear

      public void clear()
      Specified by:
      clear in interface Clearable
      Mappings:
      Namespace Name Mixin selector
      official a Lbbl;a()V
      intermediary method_5448 Lnet/minecraft/class_3829;method_5448()V
      named clear Lnet/minecraft/util/Clearable;clear()V
    • getBookCount

      public int getBookCount()
      Mappings:
      Namespace Name Mixin selector
      official f Lcvt;f()I
      intermediary method_45466 Lnet/minecraft/class_7716;method_45466()I
      named getBookCount Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getBookCount()I
    • isFull

      public boolean isFull()
      Mappings:
      Namespace Name Mixin selector
      official g Lcvt;g()Z
      intermediary method_45467 Lnet/minecraft/class_7716;method_45467()Z
      named isFull Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;isFull()Z
    • isEmpty

      public boolean isEmpty()
      Mappings:
      Namespace Name Mixin selector
      official i Lcvt;i()Z
      intermediary method_45468 Lnet/minecraft/class_7716;method_45468()Z
      named isEmpty Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;isEmpty()Z