Class DebugSupport

java.lang.Object
com.hypixel.hytale.server.npc.role.support.DebugSupport
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class DebugSupport extends Object implements Component<EntityStore>
Created on 07/03/2019
  • Constructor Details

    • DebugSupport

      public DebugSupport(@Nonnull SupportConfigBuilder<?> builder)
    • DebugSupport

      public DebugSupport()
  • Method Details

    • getComponentType

      @Nonnull public static ComponentType<EntityStore, DebugSupport> getComponentType()
    • get

      @Nonnull public static DebugSupport get(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> accessor)
    • getDebugDisplay

      @Nullable public RoleDebugDisplay getDebugDisplay()
    • isTraceSuccess

      public boolean isTraceSuccess()
    • isTraceFail

      public boolean isTraceFail()
    • isTraceSensorFails

      public boolean isTraceSensorFails()
    • setLastFailingSensor

      public void setLastFailingSensor(Sensor sensor)
    • getLastFailingSensor

      public Sensor getLastFailingSensor()
    • isDebugRoleSteering

      public boolean isDebugRoleSteering()
    • isDebugMotionSteering

      public boolean isDebugMotionSteering()
    • setDisplayCustomString

      public void setDisplayCustomString(@Nullable String displayCustomString)
    • pollDisplayCustomString

      @Nullable public String pollDisplayCustomString()
    • setDisplayPathfinderString

      public void setDisplayPathfinderString(@Nullable String displayPathfinderString)
    • pollDisplayPathfinderString

      @Nullable public String pollDisplayPathfinderString()
    • getDebugFlags

      public EnumSet<RoleDebugFlags> getDebugFlags()
    • setDebugFlags

      public void setDebugFlags(EnumSet<RoleDebugFlags> debugFlags)
    • isDebugFlagSet

      public boolean isDebugFlagSet(RoleDebugFlags flag)
    • isAnyDebugFlagSet

      public boolean isAnyDebugFlagSet(@Nonnull EnumSet<RoleDebugFlags> flags)
    • registerDebugFlagsListener

      public void registerDebugFlagsListener(DebugSupport.DebugFlagsChangeListener listener)
    • removeDebugFlagsListener

      public void removeDebugFlagsListener(DebugSupport.DebugFlagsChangeListener listener)
    • notifyDebugFlagsListeners

      public void notifyDebugFlagsListeners(EnumSet<RoleDebugFlags> flags)
    • isVisSensorRanges

      public boolean isVisSensorRanges()
      Returns whether sensor range visualization is enabled.
    • beginSensorVisualization

      public void beginSensorVisualization()
      Resets sensor visualization data at the start of each tick. Clears list contents but keeps map entries to reuse ArrayList instances.
    • recordSensorRange

      public int recordSensorRange(double range, double minRange, double viewAngle)
      Records a sensor's detection range for visualization with optional view cone.
      Parameters:
      range - The outer detection range.
      minRange - The inner detection range (minimum distance).
      viewAngle - The view cone angle in radians (0 for full circle).
      Returns:
      The color index assigned to this sensor.
    • recordEntityCheck

      public void recordEntityCheck(@Nonnull Ref<EntityStore> entityRef, int sensorColorIndex, boolean matched)
      Records an entity that was checked by a sensor.
      Parameters:
      entityRef - The entity reference.
      sensorColorIndex - The color index of the sensor that checked it.
      matched - Whether the entity matched the sensor's criteria.
    • getSensorVisData

      @Nullable public List<DebugSupport.SensorVisData> getSensorVisData()
      Returns the list of sensor visualization data, or null if none.
    • getEntityVisData

      @Nullable public Map<Ref<EntityStore>, List<DebugSupport.EntityVisData>> getEntityVisData()
      Returns the map of entity visualization data, or null if none.
    • hasSensorVisData

      public boolean hasSensorVisData()
      Returns whether there is any sensor visualization data to render.
    • clearSensorVisData

      public void clearSensorVisData()
      Clears the sensor visualization data after rendering.
    • isVisPath

      public boolean isVisPath()
      Returns whether path visualization is enabled.
    • clearPathVisualization

      public void clearPathVisualization()
      Clears all path visualization data.
    • recordPathWaypoint

      public void recordPathWaypoint(@Nonnull org.joml.Vector3d position, boolean isCurrentTarget, boolean isEndNode)
      Records a path waypoint for visualization.
      Parameters:
      position - The world position of the waypoint.
      isCurrentTarget - Whether this is the current target waypoint.
      isEndNode - Whether this is the final destination node.
    • recordPathWaypoint

      public void recordPathWaypoint(@Nonnull org.joml.Vector3d position, boolean isCurrentTarget, boolean isEndNode, boolean isSeekTarget)
      Records a path waypoint for visualization.
      Parameters:
      position - The world position of the waypoint.
      isCurrentTarget - Whether this is the current target waypoint.
      isEndNode - Whether this is the final destination node.
      isSeekTarget - Whether this is a seek/steering target (not pathfinding).
    • getPathVisData

      @Nullable public List<DebugSupport.PathWaypointVisData> getPathVisData()
      Returns the list of path visualization data, or null if none.
    • hasPathVisData

      public boolean hasPathVisData()
      Returns whether there is any path visualization data to render.
    • clone

      public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.