类 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 chzintermediary net/minecraft/class_5561named net/minecraft/block/entity/ChestStateManager
-
-
字段概要
字段 修饰符和类型 字段 说明 private static intfield_31339private intviewerCount
-
构造器概要
构造器 构造器 说明 ChestStateManager()
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidcloseChest(PlayerEntity player, World world, BlockPos pos, BlockState state)private intgetInRangeViewerCount(World world, BlockPos pos)intgetViewerCount()protected abstract booleanisPlayerViewing(PlayerEntity player)Determines whether the given player is currently viewing this chest.protected abstract voidonChestClosed(World world, BlockPos pos, BlockState state)Run when this chest closes (when the viewer count reaches zero).protected abstract voidonChestOpened(World world, BlockPos pos, BlockState state)Run when this chest is opened (when the viewer count becomes nonzero).protected abstract voidonInteracted(World world, BlockPos pos, BlockState state, int oldViewerCount, int newViewerCount)Run when a player interacts with this chest.voidopenChest(PlayerEntity player, World world, BlockPos pos, BlockState state)private static voidscheduleBlockTick(World world, BlockPos pos, BlockState state)voidupdateViewerCount(World world, BlockPos pos, BlockState state)
-
-
-
字段详细资料
-
field_31339
private static final int field_31339
- 另请参阅:
- 常量字段值
- Mappings:
Namespace Name Mixin selector official aLchz;a:Iintermediary field_31339Lnet/minecraft/class_5561;field_31339:Inamed field_31339Lnet/minecraft/block/entity/ChestStateManager;field_31339:I
-
viewerCount
private int viewerCount
- Mappings:
Namespace Name Mixin selector official bLchz;b:Iintermediary field_27215Lnet/minecraft/class_5561;field_27215:Inamed viewerCountLnet/minecraft/block/entity/ChestStateManager;viewerCount:I
-
-
方法详细资料
-
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 aLchz;a(Lbvr;Lgb;Lcjr;)Vintermediary method_31681Lnet/minecraft/class_5561;method_31681(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed onChestOpenedLnet/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 bLchz;b(Lbvr;Lgb;Lcjr;)Vintermediary method_31683Lnet/minecraft/class_5561;method_31683(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed onChestClosedLnet/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 aLchz;a(Lbvr;Lgb;Lcjr;II)Vintermediary method_31682Lnet/minecraft/class_5561;method_31682(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;II)Vnamed onInteractedLnet/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 aLchz;a(Lbjf;)Zintermediary method_31679Lnet/minecraft/class_5561;method_31679(Lnet/minecraft/class_1657;)Znamed isPlayerViewingLnet/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 aLchz;a(Lbjf;Lbvr;Lgb;Lcjr;)Vintermediary method_31684Lnet/minecraft/class_5561;method_31684(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed openChestLnet/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 bLchz;b(Lbjf;Lbvr;Lgb;Lcjr;)Vintermediary method_31685Lnet/minecraft/class_5561;method_31685(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed closeChestLnet/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 aLchz;a(Lbvr;Lgb;)Iintermediary method_31680Lnet/minecraft/class_5561;method_31680(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Inamed getInRangeViewerCountLnet/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 cLchz;c(Lbvr;Lgb;Lcjr;)Vintermediary method_31686Lnet/minecraft/class_5561;method_31686(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed updateViewerCountLnet/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 aLchz;a()Iintermediary method_31678Lnet/minecraft/class_5561;method_31678()Inamed getViewerCountLnet/minecraft/block/entity/ChestStateManager;getViewerCount()I
-
scheduleBlockTick
private static void scheduleBlockTick(World world, BlockPos pos, BlockState state)
- Mappings:
Namespace Name Mixin selector official dLchz;d(Lbvr;Lgb;Lcjr;)Vintermediary method_31687Lnet/minecraft/class_5561;method_31687(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed scheduleBlockTickLnet/minecraft/block/entity/ChestStateManager;scheduleBlockTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
-