Package net.minecraft.block.entity
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 cgb
intermediary net/minecraft/class_5561
named net/minecraft/block/entity/ChestStateManager
-
Field Summary
Fields Modifier and Type Field Description private int
viewerCount
-
Constructor Summary
Constructors Constructor Description ChestStateManager()
-
Method Summary
Modifier and Type Method Description void
closeChest(PlayerEntity player, World world, BlockPos pos, BlockState state)
private int
getInRangeViewerCount(World world, BlockPos pos)
int
getViewerCount()
protected abstract boolean
isPlayerViewing(PlayerEntity player)
Determines whether the given player is currently viewing this chest.protected abstract void
onChestClosed(World world, BlockPos pos, BlockState state)
Run when this chest closes (when the viewer count reaches zero).protected abstract void
onChestOpened(World world, BlockPos pos, BlockState state)
Run when this chest is opened (when the viewer count becomes nonzero).protected abstract void
onInteracted(World world, BlockPos pos, BlockState state, int oldViewerCount, int newViewerCount)
Run when a player interacts with this chest.void
openChest(PlayerEntity player, World world, BlockPos pos, BlockState state)
private static void
scheduleBlockTick(World world, BlockPos pos, BlockState state)
void
updateViewerCount(World world, BlockPos pos, BlockState state)
-
Field Details
-
viewerCount
private int viewerCount- Mappings:
Namespace Name Mixin selector official a
Lcgb;a: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
Run when this chest is opened (when the viewer count becomes nonzero).- Mappings:
Namespace Name Mixin selector official a
Lcgb;a(Lbtv;Lfx;Lcht;)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
Run when this chest closes (when the viewer count reaches zero).- Mappings:
Namespace Name Mixin selector official b
Lcgb;b(Lbtv;Lfx;Lcht;)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
Lcgb;a(Lbtv;Lfx;Lcht;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
Determines whether the given player is currently viewing this chest.- Mappings:
Namespace Name Mixin selector official a
Lcgb;a(Lbhl;)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
- Mappings:
Namespace Name Mixin selector official a
Lcgb;a(Lbhl;Lbtv;Lfx;Lcht;)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
- Mappings:
Namespace Name Mixin selector official b
Lcgb;b(Lbhl;Lbtv;Lfx;Lcht;)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
- Mappings:
Namespace Name Mixin selector official a
Lcgb;a(Lbtv;Lfx;)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
- Mappings:
Namespace Name Mixin selector official c
Lcgb;c(Lbtv;Lfx;Lcht;)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
Lcgb;a()I
intermediary method_31678
Lnet/minecraft/class_5561;method_31678()I
named getViewerCount
Lnet/minecraft/block/entity/ChestStateManager;getViewerCount()I
-
scheduleBlockTick
- Mappings:
Namespace Name Mixin selector official d
Lcgb;d(Lbtv;Lfx;Lcht;)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
-