Class EnderChestInventory

java.lang.Object
net.minecraft.inventory.SimpleInventory
net.minecraft.inventory.EnderChestInventory
All Implemented Interfaces:
Inventory, RecipeInputProvider, Clearable

public class EnderChestInventory extends SimpleInventory
Represents an inventory used for ender chests. A new instance is created for each player.
Mappings:
Namespace Name
named net/minecraft/inventory/EnderChestInventory
intermediary net/minecraft/class_1730
official crh
  • Field Details

    • activeBlockEntity

      @Nullable private @Nullable EnderChestBlockEntity activeBlockEntity
      Mappings:
      Namespace Name Mixin selector
      named activeBlockEntity Lnet/minecraft/inventory/EnderChestInventory;activeBlockEntity:Lnet/minecraft/block/entity/EnderChestBlockEntity;
      intermediary field_7864 Lnet/minecraft/class_1730;field_7864:Lnet/minecraft/class_2611;
      official b Lcrh;b:Ldrd;
  • Constructor Details

    • EnderChestInventory

      public EnderChestInventory()
  • Method Details

    • setActiveBlockEntity

      public void setActiveBlockEntity(EnderChestBlockEntity blockEntity)
      Sets the block entity the player is using to access the inventory to blockEntity. The block entity is used to delegate canPlayerUse(net.minecraft.entity.player.PlayerEntity), onOpen(net.minecraft.entity.player.PlayerEntity), and onClose(net.minecraft.entity.player.PlayerEntity).
      Mappings:
      Namespace Name Mixin selector
      named setActiveBlockEntity Lnet/minecraft/inventory/EnderChestInventory;setActiveBlockEntity(Lnet/minecraft/block/entity/EnderChestBlockEntity;)V
      intermediary method_7661 Lnet/minecraft/class_1730;method_7661(Lnet/minecraft/class_2611;)V
      official a Lcrh;a(Ldrd;)V
    • isActiveBlockEntity

      public boolean isActiveBlockEntity(EnderChestBlockEntity blockEntity)
      Returns whether this inventory is being accessed from blockEntity.
      Returns:
      whether this inventory is being accessed from blockEntity
      Mappings:
      Namespace Name Mixin selector
      named isActiveBlockEntity Lnet/minecraft/inventory/EnderChestInventory;isActiveBlockEntity(Lnet/minecraft/block/entity/EnderChestBlockEntity;)Z
      intermediary method_31556 Lnet/minecraft/class_1730;method_31556(Lnet/minecraft/class_2611;)Z
      official b Lcrh;b(Ldrd;)Z
    • readNbtList

      public void readNbtList(NbtList list, RegistryWrapper.WrapperLookup registries)
      Reads the item stacks from nbtList.
      Overrides:
      readNbtList in class SimpleInventory
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named readNbtList Lnet/minecraft/inventory/SimpleInventory;readNbtList(Lnet/minecraft/nbt/NbtList;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
      intermediary method_7659 Lnet/minecraft/class_1277;method_7659(Lnet/minecraft/class_2499;Lnet/minecraft/class_7225$class_7874;)V
      official a Lbra;a(Luh;Ljo$a;)V
    • toNbtList

      public NbtList toNbtList(RegistryWrapper.WrapperLookup registries)
      Returns an NBT list of non-empty
      invalid reference
      item stacks
      .

      Unlike Inventories.writeNbt(NbtCompound, DefaultedList, boolean, RegistryWrapper.WrapperLookup), this does not serialize the slots.

      Overrides:
      toNbtList in class SimpleInventory
      Returns:
      an NBT list of non-empty
      invalid reference
      item stacks
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toNbtList Lnet/minecraft/inventory/SimpleInventory;toNbtList(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtList;
      intermediary method_7660 Lnet/minecraft/class_1277;method_7660(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2499;
      official a Lbra;a(Ljo$a;)Luh;
    • canPlayerUse

      public boolean canPlayerUse(PlayerEntity player)
      Specified by:
      canPlayerUse in interface Inventory
      Overrides:
      canPlayerUse in class SimpleInventory
      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 Lbqk;a(Lcmx;)Z
    • onOpen

      public void onOpen(PlayerEntity player)
      Called when the inventory is opened. Specifically, this is called inside the ScreenHandler constructor. This does nothing by default.

      The method is called in both the client and the server. However, because clientside screen handler is created with a SimpleInventory, other implementations can (and the vanilla code does) assume that the method is called in the server.

      Mappings:
      Namespace Name Mixin selector
      named onOpen Lnet/minecraft/inventory/Inventory;onOpen(Lnet/minecraft/entity/player/PlayerEntity;)V
      intermediary method_5435 Lnet/minecraft/class_1263;method_5435(Lnet/minecraft/class_1657;)V
      official d_ Lbqk;d_(Lcmx;)V
    • onClose

      public void onClose(PlayerEntity player)
      Called when the inventory is closed. Specifically, this is called inside ScreenHandler.onClosed(net.minecraft.entity.player.PlayerEntity). This does nothing by default.

      The method is called in both the client and the server. However, because clientside screen handler is created with a SimpleInventory, other implementations can (and the vanilla code does) assume that the method is called in the server.

      Mappings:
      Namespace Name Mixin selector
      named onClose Lnet/minecraft/inventory/Inventory;onClose(Lnet/minecraft/entity/player/PlayerEntity;)V
      intermediary method_5432 Lnet/minecraft/class_1263;method_5432(Lnet/minecraft/class_1657;)V
      official c Lbqk;c(Lcmx;)V