Class ViewerCountManager

java.lang.Object
net.minecraft.block.entity.ViewerCountManager

public abstract class ViewerCountManager extends Object
Handles the viewer count for container block entities, like chests, ender chests, and barrels.
Mappings:
Namespace Name
official cts
intermediary net/minecraft/class_5561
named net/minecraft/block/entity/ViewerCountManager
  • Field Details

    • SCHEDULE_TICK_DELAY

      private static final int SCHEDULE_TICK_DELAY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcts;a:I
      intermediary field_31339 Lnet/minecraft/class_5561;field_31339:I
      named SCHEDULE_TICK_DELAY Lnet/minecraft/block/entity/ViewerCountManager;SCHEDULE_TICK_DELAY:I
    • viewerCount

      private int viewerCount
      Mappings:
      Namespace Name Mixin selector
      official b Lcts;b:I
      intermediary field_27215 Lnet/minecraft/class_5561;field_27215:I
      named viewerCount Lnet/minecraft/block/entity/ViewerCountManager;viewerCount:I
  • Constructor Details

    • ViewerCountManager

      public ViewerCountManager()
  • Method Details

    • onContainerOpen

      protected abstract void onContainerOpen(World world, BlockPos pos, BlockState state)
      Run when this container is opened (when the viewer count becomes nonzero).
      Mappings:
      Namespace Name Mixin selector
      official a Lcts;a(Lcgx;Lgt;Lcvo;)V
      intermediary method_31681 Lnet/minecraft/class_5561;method_31681(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named onContainerOpen Lnet/minecraft/block/entity/ViewerCountManager;onContainerOpen(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • onContainerClose

      protected abstract void onContainerClose(World world, BlockPos pos, BlockState state)
      Run when this container closes (when the viewer count reaches zero).
      Mappings:
      Namespace Name Mixin selector
      official b Lcts;b(Lcgx;Lgt;Lcvo;)V
      intermediary method_31683 Lnet/minecraft/class_5561;method_31683(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named onContainerClose Lnet/minecraft/block/entity/ViewerCountManager;onContainerClose(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)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
      official a Lcts;a(Lcgx;Lgt;Lcvo;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 onViewerCountUpdate Lnet/minecraft/block/entity/ViewerCountManager;onViewerCountUpdate(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 container.
      Mappings:
      Namespace Name Mixin selector
      official a Lcts;a(Lbuc;)Z
      intermediary method_31679 Lnet/minecraft/class_5561;method_31679(Lnet/minecraft/class_1657;)Z
      named isPlayerViewing Lnet/minecraft/block/entity/ViewerCountManager;isPlayerViewing(Lnet/minecraft/entity/player/PlayerEntity;)Z
    • openContainer

      public void openContainer(PlayerEntity player, World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official a Lcts;a(Lbuc;Lcgx;Lgt;Lcvo;)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 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
    • closeContainer

      public void closeContainer(PlayerEntity player, World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official b Lcts;b(Lbuc;Lcgx;Lgt;Lcvo;)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 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
    • getInRangeViewerCount

      private int getInRangeViewerCount(World world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      official a Lcts;a(Lcgx;Lgt;)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/ViewerCountManager;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 c Lcts;c(Lcgx;Lgt;Lcvo;)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/ViewerCountManager;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 Lcts;a()I
      intermediary method_31678 Lnet/minecraft/class_5561;method_31678()I
      named getViewerCount Lnet/minecraft/block/entity/ViewerCountManager;getViewerCount()I
    • scheduleBlockTick

      private static void scheduleBlockTick(World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official d Lcts;d(Lcgx;Lgt;Lcvo;)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/ViewerCountManager;scheduleBlockTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V