Package net.minecraft.block.entity
Class ChestStateManager
java.lang.Object
net.minecraft.block.entity.ChestStateManager
Handles the viewer count for chest-like block entities.
- Mappings:
Namespace Name official cizintermediary net/minecraft/class_5561named net/minecraft/block/entity/ChestStateManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseChest(PlayerEntity player, World world, BlockPos pos, BlockState state)private intgetInRangeViewerCount(World world, BlockPos pos)intprotected 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 Details
-
field_31339
private static final int field_31339- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official aLciz;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 bLciz;b:Iintermediary field_27215Lnet/minecraft/class_5561;field_27215:Inamed viewerCountLnet/minecraft/block/entity/ChestStateManager;viewerCount:I
-
-
Constructor Details
-
ChestStateManager
public ChestStateManager()
-
-
Method Details
-
onChestOpened
Run when this chest is opened (when the viewer count becomes nonzero).- Mappings:
Namespace Name Mixin selector official aLciz;a(Lbwp;Lgg;Lcks;)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
Run when this chest closes (when the viewer count reaches zero).- Mappings:
Namespace Name Mixin selector official bLciz;b(Lbwp;Lgg;Lcks;)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 aLciz;a(Lbwp;Lgg;Lcks;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
Determines whether the given player is currently viewing this chest.- Mappings:
Namespace Name Mixin selector official aLciz;a(Lbkd;)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
- Mappings:
Namespace Name Mixin selector official aLciz;a(Lbkd;Lbwp;Lgg;Lcks;)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
- Mappings:
Namespace Name Mixin selector official bLciz;b(Lbkd;Lbwp;Lgg;Lcks;)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
- Mappings:
Namespace Name Mixin selector official aLciz;a(Lbwp;Lgg;)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
- Mappings:
Namespace Name Mixin selector official cLciz;c(Lbwp;Lgg;Lcks;)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 aLciz;a()Iintermediary method_31678Lnet/minecraft/class_5561;method_31678()Inamed getViewerCountLnet/minecraft/block/entity/ChestStateManager;getViewerCount()I
-
scheduleBlockTick
- Mappings:
Namespace Name Mixin selector official dLciz;d(Lbwp;Lgg;Lcks;)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
-