Class TickSuppressionRegistry

java.lang.Object
com.hypixel.hytale.server.core.universe.world.TickSuppressionRegistry
All Implemented Interfaces:
Resource<EntityStore>, Cloneable

public final class TickSuppressionRegistry extends Object implements Resource<EntityStore>
Per-world registry of regions where block ticking is suppressed. The producer (trigger volumes' NoTick rule) publishes an immutable TickSuppressionRegistry.Snapshot; the block-tick and random-tick systems query it before running a block's tick procedure. The hot tick path checks isEmpty() first, so when nothing is suppressed the cost is a single volatile read.

Keeping the point-in-region test behind a producer-supplied TickSuppressionRegistry.Snapshot means this CoreServer class needs no knowledge of trigger-volume shapes, preserving the module layering (the tick plugins depend on CoreServer, not on trigger volumes). Snapshots are immutable and published by a volatile reference swap, so the parallel tick systems read them safely.

  • Field Details

  • Constructor Details

    • TickSuppressionRegistry

      public TickSuppressionRegistry()
  • Method Details

    • ensureRegistered

      public static void ensureRegistered()
      No-op call that forces this class to load and its RESOURCE to register at startup, so the resource exists on every world's entity store before the tick systems query it.
    • isEmpty

      public boolean isEmpty()
    • hasKind

      public boolean hasKind(int kind)
      Whether any suppressed region covers the given kind. A tick loop should gate on this before querying per block, so a snapshot that suppresses only one kind imposes no per-block cost on the other kind's tick path.
    • isSuppressed

      public boolean isSuppressed(double x, double y, double z, int kind)
    • isBlockSuppressed

      public boolean isBlockSuppressed(int blockX, int blockY, int blockZ, int kind)
      Whether the block at the given integer coordinates is suppressed, testing the block center against the region so a block counts as covered when its center falls inside the volume.
    • setSnapshot

      public void setSnapshot(@Nullable TickSuppressionRegistry.Snapshot snapshot, int activeKinds)
    • clone

      @Nonnull public TickSuppressionRegistry clone()
      Specified by:
      clone in interface Resource<EntityStore>
      Returns:
      a clone instance of the original resource instance.