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/ViewerCountManagerintermediary net/minecraft/class_5561official egu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate static final intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseContainer(LivingEntity user, World world, BlockPos pos, BlockState state) intgetViewingUsers(World world, BlockPos pos) private booleanhasViewingUsers(Entity entity, BlockPos blockPos) abstract booleanisPlayerViewing(PlayerEntity player) Determines whether the given player is currently viewing this container.protected abstract voidonContainerClose(World world, BlockPos pos, BlockState state) Run when this container closes (when the viewer count reaches zero).protected abstract voidonContainerOpen(World world, BlockPos pos, BlockState state) Run when this container is opened (when the viewer count becomes nonzero).protected abstract voidonViewerCountUpdate(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.voidopenContainer(LivingEntity user, World world, BlockPos pos, BlockState state, double userInteractionRange) private static voidscheduleBlockTick(World world, BlockPos pos, BlockState state) voidupdateViewerCount(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_DELAYLnet/minecraft/block/entity/ViewerCountManager;SCHEDULE_TICK_DELAY:Iintermediary field_31339Lnet/minecraft/class_5561;field_31339:Iofficial aLegu;a:I
-
viewerCount
private int viewerCount- Mappings:
Namespace Name Mixin selector named viewerCountLnet/minecraft/block/entity/ViewerCountManager;viewerCount:Iintermediary field_27215Lnet/minecraft/class_5561;field_27215:Iofficial bLegu;b:I
-
maxBlockInteractionRange
private double maxBlockInteractionRange- Mappings:
Namespace Name Mixin selector named maxBlockInteractionRangeLnet/minecraft/block/entity/ViewerCountManager;maxBlockInteractionRange:Dintermediary field_48376Lnet/minecraft/class_5561;field_48376:Dofficial cLegu;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 onContainerOpenLnet/minecraft/block/entity/ViewerCountManager;onContainerOpen(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_31681Lnet/minecraft/class_5561;method_31681(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial aLegu;a(Ldrq;Lja;Lejm;)V
-
onContainerClose
Run when this container closes (when the viewer count reaches zero).- Mappings:
Namespace Name Mixin selector named onContainerCloseLnet/minecraft/block/entity/ViewerCountManager;onContainerClose(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_31683Lnet/minecraft/class_5561;method_31683(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial bLegu;b(Ldrq;Lja;Lejm;)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 onViewerCountUpdateLnet/minecraft/block/entity/ViewerCountManager;onViewerCountUpdate(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Vintermediary method_31682Lnet/minecraft/class_5561;method_31682(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;II)Vofficial aLegu;a(Ldrq;Lja;Lejm;II)V
-
isPlayerViewing
Determines whether the given player is currently viewing this container.- Mappings:
Namespace Name Mixin selector named isPlayerViewingLnet/minecraft/block/entity/ViewerCountManager;isPlayerViewing(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_31679Lnet/minecraft/class_5561;method_31679(Lnet/minecraft/class_1657;)Zofficial aLegu;a(Lczl;)Z
-
openContainer
public void openContainer(LivingEntity user, World world, BlockPos pos, BlockState state, double userInteractionRange) - Mappings:
Namespace Name Mixin selector named openContainerLnet/minecraft/block/entity/ViewerCountManager;openContainer(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;D)Vintermediary method_31684Lnet/minecraft/class_5561;method_31684(Lnet/minecraft/class_1309;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;D)Vofficial aLegu;a(Lcew;Ldrq;Lja;Lejm;D)V
-
closeContainer
- Mappings:
Namespace Name Mixin selector named closeContainerLnet/minecraft/block/entity/ViewerCountManager;closeContainer(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_31685Lnet/minecraft/class_5561;method_31685(Lnet/minecraft/class_1309;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial aLegu;a(Lcew;Ldrq;Lja;Lejm;)V
-
getViewingUsers
- Mappings:
Namespace Name Mixin selector named getViewingUsersLnet/minecraft/block/entity/ViewerCountManager;getViewingUsers(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Ljava/util/List;intermediary method_56121Lnet/minecraft/class_5561;method_56121(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Ljava/util/List;official aLegu;a(Ldrq;Lja;)Ljava/util/List;
-
hasViewingUsers
- Mappings:
Namespace Name Mixin selector named hasViewingUsersLnet/minecraft/block/entity/ViewerCountManager;hasViewingUsers(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/BlockPos;)Zintermediary method_72654Lnet/minecraft/class_5561;method_72654(Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)Zofficial aLegu;a(Lcdv;Lja;)Z
-
updateViewerCount
- Mappings:
Namespace Name Mixin selector named updateViewerCountLnet/minecraft/block/entity/ViewerCountManager;updateViewerCount(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_31686Lnet/minecraft/class_5561;method_31686(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial cLegu;c(Ldrq;Lja;Lejm;)V
-
getViewerCount
public int getViewerCount()- Mappings:
Namespace Name Mixin selector named getViewerCountLnet/minecraft/block/entity/ViewerCountManager;getViewerCount()Iintermediary method_31678Lnet/minecraft/class_5561;method_31678()Iofficial aLegu;a()I
-
scheduleBlockTick
- Mappings:
Namespace Name Mixin selector named scheduleBlockTickLnet/minecraft/block/entity/ViewerCountManager;scheduleBlockTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_31687Lnet/minecraft/class_5561;method_31687(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial dLegu;d(Ldrq;Lja;Lejm;)V
-