类 ChestStateManager


  • public abstract class ChestStateManager
    extends Object
    Handles the viewer count for chest-like block entities.
    Mappings:
    Namespace Name
    official chz
    intermediary net/minecraft/class_5561
    named net/minecraft/block/entity/ChestStateManager
    • 字段详细资料

      • field_31339

        private static final int field_31339
        另请参阅:
        常量字段值
        Mappings:
        Namespace Name Mixin selector
        official a Lchz;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 Lchz;b:I
        intermediary field_27215 Lnet/minecraft/class_5561;field_27215:I
        named viewerCount Lnet/minecraft/block/entity/ChestStateManager;viewerCount:I
    • 构造器详细资料

      • ChestStateManager

        public ChestStateManager()
    • 方法详细资料

      • 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 Lchz;a(Lbvr;Lgb;Lcjr;)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 Lchz;b(Lbvr;Lgb;Lcjr;)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 Lchz;a(Lbvr;Lgb;Lcjr;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 Lchz;a(Lbjf;)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 Lchz;a(Lbjf;Lbvr;Lgb;Lcjr;)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 Lchz;b(Lbjf;Lbvr;Lgb;Lcjr;)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 Lchz;a(Lbvr;Lgb;)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 Lchz;c(Lbvr;Lgb;Lcjr;)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 Lchz;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 Lchz;d(Lbvr;Lgb;Lcjr;)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