Contents
Class PositionCacheSystems
java.lang.Object
com.hypixel.hytale.server.npc.systems.PositionCacheSystems
Handles the NPC
PositionCache, including its updates and initialisation. The PositionCache is used by NPCs to quickly determine where other entities
are in the world and is not updated every tick, but rather staggered in such a way that NPCs run their PositionCache updates in different ticks to reduce
dips in performance.
Created on 09/12/2020-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classA holder system that handles the activation of the position cache of an NPC entitystatic classA steppable ticking system that handles updating the position cache of an NPC entity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinitialisePositionCache(ExecutionSupport executionSupport, Role role, StateEvaluator stateEvaluator, double flockInfluenceRange) Initializes the position cache for the givenRoleinstance.static voidregisterInstructionsWithCache(ExecutionSupport executionSupport, Instruction rootInstruction, Instruction interactionInstruction, Instruction deathInstruction, StateEvaluator stateEvaluator) Registers an instruction tree (and optional interaction/death instructions, state transitions and state evaluator) with thePositionCacheon the givenExecutionSupport, then finalizes it.
-
Constructor Details
-
PositionCacheSystems
public PositionCacheSystems()
-
-
Method Details
-
initialisePositionCache
public static void initialisePositionCache(@Nonnull ExecutionSupport executionSupport, @Nonnull Role role, @Nullable StateEvaluator stateEvaluator, double flockInfluenceRange) Initializes the position cache for the givenRoleinstance. -
registerInstructionsWithCache
public static void registerInstructionsWithCache(@Nonnull ExecutionSupport executionSupport, @Nonnull Instruction rootInstruction, @Nullable Instruction interactionInstruction, @Nullable Instruction deathInstruction, @Nullable StateEvaluator stateEvaluator) Registers an instruction tree (and optional interaction/death instructions, state transitions and state evaluator) with thePositionCacheon the givenExecutionSupport, then finalizes it.
-