Class ChiseledBookshelfBlockEntity

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

public class ChiseledBookshelfBlockEntity extends BlockEntity implements Inventory
Mappings:
Namespace Name
official dde
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 c Ldde;c:I
      intermediary field_40331 Lnet/minecraft/class_7716;field_40331:I
      named MAX_BOOKS Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;MAX_BOOKS:I
    • LOGGER

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

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

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

    • ChiseledBookshelfBlockEntity

      public ChiseledBookshelfBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldde;<init>(Lgw;Ldfj;)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

    • updateState

      private void updateState(int interactedSlot)
      Mappings:
      Namespace Name Mixin selector
      official c Ldde;c(I)V
      intermediary method_47585 Lnet/minecraft/class_7716;method_47585(I)V
      named updateState Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;updateState(I)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 Ldcv;a(Lqw;)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 Ldcv;b(Lqw;)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
    • getOpenSlotCount

      public int getOpenSlotCount()
      Mappings:
      Namespace Name Mixin selector
      official f Ldde;f()I
      intermediary method_47587 Lnet/minecraft/class_7716;method_47587()I
      named getOpenSlotCount Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;getOpenSlotCount()I
    • clear

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

      public int size()
      Returns the size of the inventory.

      The inventory should support the slot ID from 0 to size() - 1. This should remain constant throughout the inventory's lifetime.

      Specified by:
      size in interface Inventory
      Returns:
      the size of the inventory
      Mappings:
      Namespace Name Mixin selector
      official b Lbgr;b()I
      intermediary method_5439 Lnet/minecraft/class_1263;method_5439()I
      named size Lnet/minecraft/inventory/Inventory;size()I
    • isEmpty

      public boolean isEmpty()
      Returns whether the inventory consists entirely of empty item stacks.
      Specified by:
      isEmpty in interface Inventory
      Returns:
      whether the inventory consists entirely of empty item stacks
      Mappings:
      Namespace Name Mixin selector
      official af_ Lbgr;af_()Z
      intermediary method_5442 Lnet/minecraft/class_1263;method_5442()Z
      named isEmpty Lnet/minecraft/inventory/Inventory;isEmpty()Z
    • getStack

      public ItemStack getStack(int slot)
      Returns the stack currently stored at slot.

      If the slot is empty, or is outside the bounds of this inventory, this returns ItemStack.EMPTY.

      Specified by:
      getStack in interface Inventory
      Returns:
      the stack currently stored at slot
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(I)Lcjf;
      intermediary method_5438 Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
      named getStack Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
    • removeStack

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

      public ItemStack removeStack(int slot)
      Removes the stack currently stored at slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the stack previously stored at the indicated slot
      Mappings:
      Namespace Name Mixin selector
      official b Lbgr;b(I)Lcjf;
      intermediary method_5441 Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
      named removeStack Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
    • setStack

      public void setStack(int slot, ItemStack stack)
      Sets the stack stored at slot to stack.
      Specified by:
      setStack in interface Inventory
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(ILcjf;)V
      intermediary method_5447 Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
      named setStack Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)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
      official a Lbgr;a(Lbgr;ILcjf;)Z
      intermediary method_49104 Lnet/minecraft/class_1263;method_49104(Lnet/minecraft/class_1263;ILnet/minecraft/class_1799;)Z
      named canTransferTo Lnet/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:
      getMaxCountPerStack in interface Inventory
      Returns:
      the maximum number of items a stack can contain when placed inside this inventory
      Mappings:
      Namespace Name Mixin selector
      official ag_ Lbgr;ag_()I
      intermediary method_5444 Lnet/minecraft/class_1263;method_5444()I
      named getMaxCountPerStack Lnet/minecraft/inventory/Inventory;getMaxCountPerStack()I
    • canPlayerUse

      public boolean canPlayerUse(PlayerEntity player)
      Specified by:
      canPlayerUse in interface Inventory
      Returns:
      whether player can use this inventory
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lbgr;a(Lcbu;)Z
      intermediary method_5443 Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
      named canPlayerUse Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
    • isValid

      public boolean isValid(int slot, ItemStack stack)
      Returns whether stack is valid for the slot.

      Implementations can, for example, use this to check whether the item is in a specific tag. This returns true by default.

      Specified by:
      isValid in interface Inventory
      Returns:
      whether stack is valid for the slot
      Mappings:
      Namespace Name Mixin selector
      official b Lbgr;b(ILcjf;)Z
      intermediary method_5437 Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Z
      named isValid Lnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Z
    • getLastInteractedSlot

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