Class PositionCacheSystems

java.lang.Object
com.hypixel.hytale.server.npc.systems.PositionCacheSystems

public class PositionCacheSystems extends Object
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
  • 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 given Role instance.
    • 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 the PositionCache on the given ExecutionSupport, then finalizes it.