Class ChestStateManager

java.lang.Object
net.minecraft.block.entity.ChestStateManager

public abstract class ChestStateManager extends Object
Handles the viewer count for chest-like block entities.
Mappings:
Namespace Name
official ciz
intermediary net/minecraft/class_5561
named net/minecraft/block/entity/ChestStateManager
  • Field Details

    • field_31339

      private static final int field_31339
      See Also:
      Constant Field Values
      Mappings:
      Namespace Name Mixin selector
      official a Lciz;a:I
      intermediary field_31339 Lnet/minecraft/class_5561;field_31339:I
      named field_31339 Lnet/minecraft/block/entity/ChestStateManager;field_31339:I
    • viewerCount

      private int viewerCount
      Mappings:
      Namespace Name Mixin selector
      official b Lciz;b:I
      intermediary field_27215 Lnet/minecraft/class_5561;field_27215:I
      named viewerCount Lnet/minecraft/block/entity/ChestStateManager;viewerCount:I
  • Constructor Details

    • ChestStateManager

      public ChestStateManager()
  • Method Details

    • onChestOpened

      protected abstract void onChestOpened(World world, BlockPos pos, BlockState state)
      Run when this chest is opened (when the viewer count becomes nonzero).
      Mappings:
      Namespace Name Mixin selector
      official a Lciz;a(Lbwp;Lgg;Lcks;)V
      intermediary method_31681 Lnet/minecraft/class_5561;method_31681(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named onChestOpened Lnet/minecraft/block/entity/ChestStateManager;onChestOpened(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • onChestClosed

      protected abstract void onChestClosed(World world, BlockPos pos, BlockState state)
      Run when this chest closes (when the viewer count reaches zero).
      Mappings:
      Namespace Name Mixin selector
      official b Lciz;b(Lbwp;Lgg;Lcks;)V
      intermediary method_31683 Lnet/minecraft/class_5561;method_31683(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named onChestClosed Lnet/minecraft/block/entity/ChestStateManager;onChestClosed(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • onInteracted

      protected abstract void onInteracted(World world, BlockPos pos, BlockState state, int oldViewerCount, int newViewerCount)
      Run when a player interacts with this chest.
      Mappings:
      Namespace Name Mixin selector
      official a Lciz;a(Lbwp;Lgg;Lcks;II)V
      intermediary method_31682 Lnet/minecraft/class_5561;method_31682(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;II)V
      named onInteracted Lnet/minecraft/block/entity/ChestStateManager;onInteracted(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)V
    • isPlayerViewing

      protected abstract boolean isPlayerViewing(PlayerEntity player)
      Determines whether the given player is currently viewing this chest.
      Mappings:
      Namespace Name Mixin selector
      official a Lciz;a(Lbkd;)Z
      intermediary method_31679 Lnet/minecraft/class_5561;method_31679(Lnet/minecraft/class_1657;)Z
      named isPlayerViewing Lnet/minecraft/block/entity/ChestStateManager;isPlayerViewing(Lnet/minecraft/entity/player/PlayerEntity;)Z
    • openChest

      public void openChest(PlayerEntity player, World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official a Lciz;a(Lbkd;Lbwp;Lgg;Lcks;)V
      intermediary method_31684 Lnet/minecraft/class_5561;method_31684(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named openChest Lnet/minecraft/block/entity/ChestStateManager;openChest(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • closeChest

      public void closeChest(PlayerEntity player, World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official b Lciz;b(Lbkd;Lbwp;Lgg;Lcks;)V
      intermediary method_31685 Lnet/minecraft/class_5561;method_31685(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named closeChest Lnet/minecraft/block/entity/ChestStateManager;closeChest(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • getInRangeViewerCount

      private int getInRangeViewerCount(World world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      official a Lciz;a(Lbwp;Lgg;)I
      intermediary method_31680 Lnet/minecraft/class_5561;method_31680(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)I
      named getInRangeViewerCount Lnet/minecraft/block/entity/ChestStateManager;getInRangeViewerCount(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I
    • updateViewerCount

      public void updateViewerCount(World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official c Lciz;c(Lbwp;Lgg;Lcks;)V
      intermediary method_31686 Lnet/minecraft/class_5561;method_31686(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named updateViewerCount Lnet/minecraft/block/entity/ChestStateManager;updateViewerCount(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • getViewerCount

      public int getViewerCount()
      Mappings:
      Namespace Name Mixin selector
      official a Lciz;a()I
      intermediary method_31678 Lnet/minecraft/class_5561;method_31678()I
      named getViewerCount Lnet/minecraft/block/entity/ChestStateManager;getViewerCount()I
    • scheduleBlockTick

      private static void scheduleBlockTick(World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official d Lciz;d(Lbwp;Lgg;Lcks;)V
      intermediary method_31687 Lnet/minecraft/class_5561;method_31687(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named scheduleBlockTick Lnet/minecraft/block/entity/ChestStateManager;scheduleBlockTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V