Class ChiseledBookshelfBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.ChiseledBookshelfBlockEntity
All Implemented Interfaces:
Iterable<ItemStack>, Inventory, ListInventory, Clearable, DebugTrackable

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

    • MAX_BOOKS

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

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;LOGGER:Lorg/slf4j/Logger;
      intermediary field_40898 Lnet/minecraft/class_7716;field_40898:Lorg/slf4j/Logger;
      official c Legq;c:Lorg/slf4j/Logger;
    • DEFAULT_LAST_INTERACTED_SLOT

      private static final int DEFAULT_LAST_INTERACTED_SLOT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_LAST_INTERACTED_SLOT Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;DEFAULT_LAST_INTERACTED_SLOT:I
      intermediary field_57771 Lnet/minecraft/class_7716;field_57771:I
      official d Legq;d:I
    • heldStacks

      private final DefaultedList<ItemStack> heldStacks
      Mappings:
      Namespace Name Mixin selector
      named heldStacks Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;heldStacks:Lnet/minecraft/util/collection/DefaultedList;
      intermediary field_41314 Lnet/minecraft/class_7716;field_41314:Lnet/minecraft/class_2371;
      official e Legq;e:Ljt;
    • lastInteractedSlot

      private int lastInteractedSlot
      Mappings:
      Namespace Name Mixin selector
      named lastInteractedSlot Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;lastInteractedSlot:I
      intermediary field_41601 Lnet/minecraft/class_7716;field_41601:I
      official f Legq;f:I
  • Constructor Details

    • ChiseledBookshelfBlockEntity

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

    • updateState

      private void updateState(int interactedSlot)
      Mappings:
      Namespace Name Mixin selector
      named updateState Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;updateState(I)V
      intermediary method_47585 Lnet/minecraft/class_7716;method_47585(I)V
      official c Legq;c(I)V
    • readData

      protected void readData(ReadView view)
      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:
      readData in class BlockEntity
      See Also:
      • invalid reference
        #writeNbt
      Mappings:
      Namespace Name Mixin selector
      named readData Lnet/minecraft/block/entity/BlockEntity;readData(Lnet/minecraft/storage/ReadView;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_11368;)V
      official a Legg;a(Lfip;)V
    • writeData

      protected void writeData(WriteView view)
      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:
      writeData in class BlockEntity
      See Also:
      • invalid reference
        #readNbt
      Mappings:
      Namespace Name Mixin selector
      named writeData Lnet/minecraft/block/entity/BlockEntity;writeData(Lnet/minecraft/storage/WriteView;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_11372;)V
      official a Legg;a(Lfir;)V
    • 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:
      getMaxCountPerStack in interface Inventory
      Returns:
      the maximum number of items a stack can contain when placed inside this inventory
      Mappings:
      Namespace Name Mixin selector
      named getMaxCountPerStack Lnet/minecraft/inventory/Inventory;getMaxCountPerStack()I
      intermediary method_5444 Lnet/minecraft/class_1263;method_5444()I
      official ap_ Lcbj;ap_()I
    • canAccept

      public boolean canAccept(ItemStack stack)
      Specified by:
      canAccept in interface ListInventory
      Mappings:
      Namespace Name Mixin selector
      named canAccept Lnet/minecraft/inventory/ListInventory;canAccept(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_72651 Lnet/minecraft/class_11596;method_72651(Lnet/minecraft/class_1799;)Z
      official b Lehp;b(Ldhp;)Z
    • removeStack

      public ItemStack removeStack(int slot, int amount)
      Removes a specific number of items from slot.
      Specified by:
      removeStack in interface Inventory
      Specified by:
      removeStack in interface ListInventory
      Returns:
      the removed items as a stack
      Mappings:
      Namespace Name Mixin selector
      named removeStack Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
      intermediary method_5434 Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
      official a Lcbj;a(II)Ldhp;
    • setStack

      public void setStack(int slot, ItemStack stack)
      Sets the stack stored at slot to stack.
      Specified by:
      setStack in interface Inventory
      Specified by:
      setStack in interface ListInventory
      Mappings:
      Namespace Name Mixin selector
      named setStack Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)V
      intermediary method_5447 Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
      official a Lcbj;a(ILdhp;)V
    • canTransferTo

      public boolean canTransferTo(Inventory hopperInventory, int slot, ItemStack stack)
      Returns whether a hopper can transfer stack from slot to the hopper.

      This returns true by default.

      Specified by:
      canTransferTo in interface Inventory
      Returns:
      whether a hopper can transfer stack from slot to the hopper
      Mappings:
      Namespace Name Mixin selector
      named canTransferTo Lnet/minecraft/inventory/Inventory;canTransferTo(Lnet/minecraft/inventory/Inventory;ILnet/minecraft/item/ItemStack;)Z
      intermediary method_49104 Lnet/minecraft/class_1263;method_49104(Lnet/minecraft/class_1263;ILnet/minecraft/class_1799;)Z
      official a Lcbj;a(Lcbj;ILdhp;)Z
    • getHeldStacks

      public DefaultedList<ItemStack> getHeldStacks()
      Specified by:
      getHeldStacks in interface ListInventory
      Mappings:
      Namespace Name Mixin selector
      named getHeldStacks Lnet/minecraft/inventory/ListInventory;getHeldStacks()Lnet/minecraft/util/collection/DefaultedList;
      intermediary method_72652 Lnet/minecraft/class_11596;method_72652()Lnet/minecraft/class_2371;
      official h Lehp;h()Ljt;
    • canPlayerUse

      public boolean canPlayerUse(PlayerEntity player)
      Specified by:
      canPlayerUse in interface Inventory
      Returns:
      whether player can 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 canPlayerUse Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_5443 Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
      official a Lcbj;a(Lczl;)Z
    • getLastInteractedSlot

      public int getLastInteractedSlot()
      Mappings:
      Namespace Name Mixin selector
      named getLastInteractedSlot Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getLastInteractedSlot()I
      intermediary method_47887 Lnet/minecraft/class_7716;method_47887()I
      official k Legq;k()I
    • readComponents

      protected void readComponents(ComponentsAccess components)
      Overrides:
      readComponents in class BlockEntity
      Mappings:
      Namespace Name Mixin selector
      named readComponents Lnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/component/ComponentsAccess;)V
      intermediary method_57568 Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_9473;)V
      official a Legg;a(Lkk;)V
    • addComponents

      protected void addComponents(ComponentMap.Builder builder)
      Overrides:
      addComponents in class BlockEntity
      Mappings:
      Namespace Name Mixin selector
      named addComponents Lnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)V
      intermediary method_57567 Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)V
      official a Legg;a(Lkm$a;)V
    • removeFromCopiedStackData

      public void removeFromCopiedStackData(WriteView view)
      Overrides:
      removeFromCopiedStackData in class BlockEntity
      Mappings:
      Namespace Name Mixin selector
      named removeFromCopiedStackData Lnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackData(Lnet/minecraft/storage/WriteView;)V
      intermediary method_57569 Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_11372;)V
      official b Legg;b(Lfir;)V