RoleDebugPreset class
Пакет: com.hypixel.hytale.server.npc.role
Файл: com/hypixel/hytale/server/npc/role/RoleDebugFlags.java
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
|
public EnumSet<RoleDebugFlags> |
config |
|
public String |
name |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.role;
class="kw">import com.hypixel.hytale.common.util.StringUtil;
class="kw">import java.util.EnumSet;
class="kw">import java.util.function.Supplier;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public enum RoleDebugFlags class="kw">implements Supplier<String> {
TraceFail("Trace failed instructions"),
TraceSuccess("Trace matched instructions"),
TraceSensorFailures("Trace failing sensors"),
Flock("Trace flock events"),
FlockDamage("Trace flock damage events"),
MotionControllerSteer("Trace steering activity of motion controllers"),
Collisions("Trace collision information of motion controllers"),
BlockCollisions("Trace collisions down to block level"),
ProbeBlockCollisions("Trace collisions down to block level when probing"),
ChargeState("Trace BodyMotionCharge state transitions"),
ChargePath("Trace BodyMotionCharge probe path data"),
MotionControllerMove("Trace movement activity of motion controllers"),
MotionControllerMoveSkipIdle("Suppress movement traces when motion controllers are idle"),
ValidatePositions("Validate computed movement positions are not intersecting blocks"),
SteeringRole("Debug blended steering behaviour from role like avoidance/separation"),
DisplayState("Set display name to contents of state"),
DisplayFlock("Set display name to flock state"),
DisplayTime("Set display name to day time"),
DisplayTarget("Set display name to locked target type"),
DisplayAnim("Display animation state"),
DisplayLightLevel("Display light levels"),
DisplayCustom("Display custom debug information (generated by debug components)"),
DisplayHP("Display NPC HP as numerical values"),
DisplayStamina("Display NPC Stamina as numerical values"),
Overlaps("Log overlapping blocks when validating position"),
NonOverlaps("Log non-overlapping blocks when validating position"),
Pathfinder("Display pathfinder status"),
DisplaySpeed("Display speed of entity"),
DisplayFreeSlots("Display free inventory slots"),
DisplayInternalId("Display the internal server ID for this entity"),
DisplayName("Display the role name for this entity"),
ValidateMath("Validate (some) math computations in movement"),
VisAvoidance("Visualize avoidance vectors"),
VisSeparationSummed("Visualize summed separation distance vector"),
VisSeparation("Visualize separation vector"),
VisSeparationTargets("Visualize separation targets"),
VisOrientation("Visualize orientation hint provided by avoidance and separation"),
VisAiming("Visualize aiming"),
VisMarkedTargets("Visualize arrows to marked targets"),
VisSensorRanges("Visualize entity sensor detection ranges"),
VisLeashPosition("Visualize NPC leash position"),
VisSteeringPre("Visualize motion steering pre separation/avoidance"),
VisSteeringPost("Visualize motion steering post separation/avoidance"),
VisTranslation("Visualize current translation vector"),
VisFlock("Visualize flock member connections"),
VisPath("Visualize pathfinding waypoints"),
VisChargePath("Visualize BodyMotionCharge rail step targets"),
VisChargeProbe("Visualize BodyMotionCharge target probing"),
VisChargeCollisions("Visualize BodyMotionCharge collision hits"),
VisChargeEntityHits("Visualize BodyMotionCharge entity hits (overrides VisChargeCollisions entity coloring)"),
BeaconMessages("Enable debugging of beacon message sending and receiving");
class="kw">private class="kw">static class="kw">final RoleDebugFlags.RoleDebugPreset[] presets = new RoleDebugFlags.RoleDebugPreset[]{
new RoleDebugFlags.RoleDebugPreset("none", EnumSet.noneOf(RoleDebugFlags.class)),
new RoleDebugFlags.RoleDebugPreset("all", EnumSet.allOf(RoleDebugFlags.class)),
new RoleDebugFlags.RoleDebugPreset("move", EnumSet.of(MotionControllerMove, Collisions)),
new RoleDebugFlags.RoleDebugPreset("steer", EnumSet.of(MotionControllerMove, MotionControllerSteer, Collisions)),
new RoleDebugFlags.RoleDebugPreset("valid", EnumSet.of(MotionControllerMove, MotionControllerSteer, Collisions, ValidatePositions)),
new RoleDebugFlags.RoleDebugPreset("block", EnumSet.of(MotionControllerMove, MotionControllerSteer, Collisions, BlockCollisions)),
new RoleDebugFlags.RoleDebugPreset(
"visDist", EnumSet.of(VisAvoidance, VisSeparation, VisSteeringPre, VisSteeringPost, VisSeparationTargets, VisSeparationSummed)
),
new RoleDebugFlags.RoleDebugPreset("visMove", EnumSet.of(VisSteeringPost, VisTranslation)),
new RoleDebugFlags.RoleDebugPreset("visSensorInfo", EnumSet.of(VisMarkedTargets, VisSensorRanges)),
new RoleDebugFlags.RoleDebugPreset(
"display",
EnumSet.of(
DisplayState,
DisplayFlock,
DisplayTime,
DisplayTarget,
DisplayAnim,
DisplayLightLevel,
DisplayCustom,
DisplayHP,
DisplayStamina,
DisplaySpeed,
DisplayFreeSlots,
DisplayInternalId,
DisplayName
)
),
new RoleDebugFlags.RoleDebugPreset("class="kw">default", EnumSet.complementOf(EnumSet.of(ValidatePositions)))
};
class="kw">private class="kw">final String description;
RoleDebugFlags(String nullxx) {
this.description = nullxx;
}
class="kw">public String get() {
class="kw">return this.description;
}
@Nonnull
class="kw">public class="kw">static EnumSet<RoleDebugFlags> getFlags(@Nonnull String[] var0) {
if (var0.length == 0) {
throw new IllegalArgumentException("Missing debug flags! " + getValidNameString());
}
EnumSet var1 = EnumSet.noneOf(RoleDebugFlags.class);
for (String var5 : var0) {
RoleDebugFlags var6 = StringUtil.parseEnum(RoleDebugFlags.class.getEnumConstants(), var5, StringUtil.MatchType.CASE_INSENSITIVE);
if (var6 != null) {
var1.add(var6);
} else {
EnumSet var7 = findPreset(var5);
if (var7 == null) {
throw new IllegalArgumentException("Invalid flag/preset '" + var5 + "'! " + getValidNameString());
}
var1.addAll(var7);
}
}
class="kw">return var1;
}
@Nonnull
class="kw">public class="kw">static StringBuilder getListOfFlags(@Nonnull EnumSet<RoleDebugFlags> var0, @Nonnull StringBuilder var1) {
boolean var2 = false;
for (RoleDebugFlags var6 : values()) {
if (var0.contains(var6)) {
if (var2) {
var1.append(", ");
}
var1.append(var6);
var2 = true;
}
}
class="kw">return var1;
}
class="kw">public class="kw">static StringBuilder getListOfAllFlags(@Nonnull StringBuilder var0) {
class="kw">return getListOfFlags(EnumSet.allOf(RoleDebugFlags.class), var0);
}
class="kw">public class="kw">static StringBuilder getListOfAllPresets(@Nonnull StringBuilder var0) {
boolean var1 = false;
for (RoleDebugFlags.RoleDebugPreset var5 : presets) {
if (var1) {
var0.append(", ");
}
var0.append(var5.name);
var1 = true;
}
class="kw">return var0;
}
@Nonnull
class="kw">public class="kw">static EnumSet<RoleDebugFlags> getPreset(String var0) {
EnumSet var1 = findPreset(var0);
if (var1 == null) {
throw new IllegalArgumentException("Invalid flag/preset '" + var0 + "'! " + getValidNameString());
}
EnumSet var2 = EnumSet.noneOf(RoleDebugFlags.class);
var2.addAll(var1);
class="kw">return var2;
}
@Nonnull
class="kw">private class="kw">static String getValidNameString() {
StringBuilder var0 = new StringBuilder();
var0.append("Valid presets are: ");
boolean var1 = false;
for (RoleDebugFlags.RoleDebugPreset var5 : presets) {
if (var1) {
var0.append(", ");
}
var0.append(var5.name);
var1 = true;
}
var0.append(". Valid flags are: ");
getListOfFlags(EnumSet.allOf(RoleDebugFlags.class), var0);
class="kw">return var0.toString();
}
@Nullable
class="kw">private class="kw">static EnumSet<RoleDebugFlags> findPreset(String var0) {
for (RoleDebugFlags.RoleDebugPreset var4 : presets) {
if (var4.name.equalsIgnoreCase(var0)) {
class="kw">return var4.config;
}
}
class="kw">return null;
}
class="kw">public class="kw">static boolean havePreset(String var0) {
for (RoleDebugFlags.RoleDebugPreset var4 : presets) {
if (var4.name.equalsIgnoreCase(var0)) {
class="kw">return true;
}
}
class="kw">return false;
}
class="kw">private class="kw">static class RoleDebugPreset {
class="kw">public String name;
class="kw">public EnumSet<RoleDebugFlags> config;
class="kw">private RoleDebugPreset(String var1, EnumSet<RoleDebugFlags> var2) {
this.name = var1;
this.config = var2;
}
}
}