Package net.minecraft.block.entity
Class ViewerCountManager
java.lang.Object
net.minecraft.block.entity.ViewerCountManager
Handles the viewer count for container block entities, like chests,
ender chests, and barrels.
- Mappings:
Namespace Name named net/minecraft/block/entity/ViewerCountManager
intermediary net/minecraft/class_5561
official dpw
-
Field Summary
Modifier and TypeFieldDescriptionprivate double
private static final int
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
closeContainer
(PlayerEntity player, World world, BlockPos pos, BlockState state) int
private List
<PlayerEntity> getViewingPlayers
(World world, BlockPos pos) protected abstract boolean
isPlayerViewing
(PlayerEntity player) Determines whether the given player is currently viewing this container.protected abstract void
onContainerClose
(World world, BlockPos pos, BlockState state) Run when this container closes (when the viewer count reaches zero).protected abstract void
onContainerOpen
(World world, BlockPos pos, BlockState state) Run when this container is opened (when the viewer count becomes nonzero).protected abstract void
onViewerCountUpdate
(World world, BlockPos pos, BlockState state, int oldViewerCount, int newViewerCount) Called when the viewer count updates, such as when a player interact with this container or when distance-based checks are run.void
openContainer
(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
-
SCHEDULE_TICK_DELAY
private static final int SCHEDULE_TICK_DELAY- See Also:
- Mappings:
Namespace Name Mixin selector named SCHEDULE_TICK_DELAY
Lnet/minecraft/block/entity/ViewerCountManager;SCHEDULE_TICK_DELAY:I
intermediary field_31339
Lnet/minecraft/class_5561;field_31339:I
official a
Ldpw;a:I
-
viewerCount
private int viewerCount- Mappings:
Namespace Name Mixin selector named viewerCount
Lnet/minecraft/block/entity/ViewerCountManager;viewerCount:I
intermediary field_27215
Lnet/minecraft/class_5561;field_27215:I
official b
Ldpw;b:I
-
maxBlockInteractionRange
private double maxBlockInteractionRange- Mappings:
Namespace Name Mixin selector named maxBlockInteractionRange
Lnet/minecraft/block/entity/ViewerCountManager;maxBlockInteractionRange:D
intermediary field_48376
Lnet/minecraft/class_5561;field_48376:D
official c
Ldpw;c:D
-
-
Constructor Details
-
ViewerCountManager
public ViewerCountManager()
-
-
Method Details
-
onContainerOpen
Run when this container is opened (when the viewer count becomes nonzero).- Mappings:
Namespace Name Mixin selector named onContainerOpen
Lnet/minecraft/block/entity/ViewerCountManager;onContainerOpen(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_31681
Lnet/minecraft/class_5561;method_31681(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official a
Ldpw;a(Ldca;Liz;Ldse;)V
-
onContainerClose
Run when this container closes (when the viewer count reaches zero).- Mappings:
Namespace Name Mixin selector named onContainerClose
Lnet/minecraft/block/entity/ViewerCountManager;onContainerClose(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_31683
Lnet/minecraft/class_5561;method_31683(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official b
Ldpw;b(Ldca;Liz;Ldse;)V
-
onViewerCountUpdate
protected abstract void onViewerCountUpdate(World world, BlockPos pos, BlockState state, int oldViewerCount, int newViewerCount) Called when the viewer count updates, such as when a player interact with this container or when distance-based checks are run.- Mappings:
Namespace Name Mixin selector named onViewerCountUpdate
Lnet/minecraft/block/entity/ViewerCountManager;onViewerCountUpdate(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;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
official a
Ldpw;a(Ldca;Liz;Ldse;II)V
-
isPlayerViewing
Determines whether the given player is currently viewing this container.- Mappings:
Namespace Name Mixin selector named isPlayerViewing
Lnet/minecraft/block/entity/ViewerCountManager;isPlayerViewing(Lnet/minecraft/entity/player/PlayerEntity;)Z
intermediary method_31679
Lnet/minecraft/class_5561;method_31679(Lnet/minecraft/class_1657;)Z
official a
Ldpw;a(Lcmz;)Z
-
openContainer
- Mappings:
Namespace Name Mixin selector named openContainer
Lnet/minecraft/block/entity/ViewerCountManager;openContainer(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)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
official a
Ldpw;a(Lcmz;Ldca;Liz;Ldse;)V
-
closeContainer
- Mappings:
Namespace Name Mixin selector named closeContainer
Lnet/minecraft/block/entity/ViewerCountManager;closeContainer(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)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
official b
Ldpw;b(Lcmz;Ldca;Liz;Ldse;)V
-
getViewingPlayers
- Mappings:
Namespace Name Mixin selector named getViewingPlayers
Lnet/minecraft/block/entity/ViewerCountManager;getViewingPlayers(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Ljava/util/List;
intermediary method_56121
Lnet/minecraft/class_5561;method_56121(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Ljava/util/List;
official a
Ldpw;a(Ldca;Liz;)Ljava/util/List;
-
updateViewerCount
- Mappings:
Namespace Name Mixin selector named updateViewerCount
Lnet/minecraft/block/entity/ViewerCountManager;updateViewerCount(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_31686
Lnet/minecraft/class_5561;method_31686(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official c
Ldpw;c(Ldca;Liz;Ldse;)V
-
getViewerCount
public int getViewerCount()- Mappings:
Namespace Name Mixin selector named getViewerCount
Lnet/minecraft/block/entity/ViewerCountManager;getViewerCount()I
intermediary method_31678
Lnet/minecraft/class_5561;method_31678()I
official a
Ldpw;a()I
-
scheduleBlockTick
- Mappings:
Namespace Name Mixin selector named scheduleBlockTick
Lnet/minecraft/block/entity/ViewerCountManager;scheduleBlockTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_31687
Lnet/minecraft/class_5561;method_31687(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official d
Ldpw;d(Ldca;Liz;Ldse;)V
-