Contents
Class TickSuppressionRegistry
java.lang.Object
com.hypixel.hytale.server.core.universe.world.TickSuppressionRegistry
- All Implemented Interfaces:
Resource<EntityStore>, Cloneable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA point-in-region test for a suppression kind. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intRandom ticks (grass and other spread).static final intScheduled growth ticks (crops, plants).static final ResourceType<EntityStore, TickSuppressionRegistry> Fields inherited from interface Resource
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static voidNo-op call that forces this class to load and itsRESOURCEto register at startup, so the resource exists on every world's entity store before the tick systems query it.booleanhasKind(int kind) Whether any suppressed region covers the given kind.booleanisBlockSuppressed(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.booleanisEmpty()booleanisSuppressed(double x, double y, double z, int kind) voidsetSnapshot(TickSuppressionRegistry.Snapshot snapshot, int activeKinds)
-
Field Details
-
KIND_SCHEDULED
public static final int KIND_SCHEDULEDScheduled growth ticks (crops, plants).- See Also:
-
KIND_RANDOM
public static final int KIND_RANDOMRandom ticks (grass and other spread).- See Also:
-
RESOURCE
-
-
Constructor Details
-
TickSuppressionRegistry
public TickSuppressionRegistry()
-
-
Method Details
-
ensureRegistered
public static void ensureRegistered()No-op call that forces this class to load and itsRESOURCEto 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
-
clone
- Specified by:
clonein interfaceResource<EntityStore>- Returns:
- a clone instance of the original resource instance.
-