PrefabPathNodesCommand class
Пакет: com.hypixel.hytale.builtin.path.commands
Файл: com/hypixel/hytale/builtin/path/commands/PrefabPathNodesCommand.java
extends: AbstractWorldCommand
Поля (10)
| Модификаторы | Тип | Имя |
|---|---|---|
|
List |
var10 |
|
int[] |
var11 |
|
Integer |
var4 |
|
UUID |
var5 |
|
Vector3d |
var5 |
|
WorldPathData |
var6 |
|
Rotation3f |
var6 |
|
IPrefabPath |
var7 |
|
StringBuilder |
var8 |
|
Message |
var9 |
Методы (3)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
if if(var7 == null) |
|
|
if if(var4x == null) |
abstract |
|
super super("nodes", "server.commands.npcpath.nodes.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.path.commands;
class="kw">import com.hypixel.hytale.builtin.path.PathPlugin;
class="kw">import com.hypixel.hytale.builtin.path.WorldPathData;
class="kw">import com.hypixel.hytale.builtin.path.path.IPrefabPath;
class="kw">import com.hypixel.hytale.builtin.path.waypoint.IPrefabPathWaypoint;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.math.vector.Rotation3f;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.command.system.CommandContext;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
class="kw">import com.hypixel.hytale.server.core.command.system.basecommands.AbstractWorldCommand;
class="kw">import com.hypixel.hytale.server.core.universe.world.World;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.List;
class="kw">import java.util.UUID;
class="kw">import java.util.logging.Level;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector3d;
class="kw">public class PrefabPathNodesCommand class="kw">extends AbstractWorldCommand {
@Nonnull
class="kw">private class="kw">final RequiredArg<Integer> worldgenIdArg = this.withRequiredArg("worldgenId", "server.commands.npcpath.nodes.worldgenId.desc", ArgTypes.INTEGER);
@Nonnull
class="kw">private class="kw">final RequiredArg<UUID> pathArg = this.withRequiredArg("path", "server.commands.npcpath.nodes.path.desc", ArgTypes.UUID);
class="kw">public PrefabPathNodesCommand() {
super("nodes", "server.commands.npcpath.nodes.desc");
}
@Override
class="kw">protected void execute(@Nonnull CommandContext var1, @Nonnull World var2, @Nonnull Store<EntityStore> var3) {
Integer var4 = this.worldgenIdArg.get(var1);
UUID var5 = this.pathArg.get(var1);
WorldPathData var6 = var3.getResource(WorldPathData.getResourceType());
IPrefabPath var7 = var6.getPrefabPath(var4, var5, true);
if (var7 == null) {
var1.sendMessage(Message.translation("server.npc.npcpath.noSuchPath").param("path", var5.toString()).param("worldgenId", var4));
} else {
StringBuilder var8 = new StringBuilder("Path [ ");
var8.append(var7.getName()).append(" ]:");
var8.append("\n Length: ").append(var7.length());
var8.append("\n Fully loaded: ").append(var7.isFullyLoaded());
var8.append("\n Waypoints: ");
Message var9 = Message.translation("server.npc.npcpath.nodes.pathDesc")
.param("name", var7.getName())
.param("length", var7.length())
.param("isLoaded", var7.isFullyLoaded());
List var10 = var7.getPathWaypoints();
int[] var11 = new int[]{0};
var10.forEach(
var4x -> {
if (var4x == null) {
var8.append("\n ").append('#').append(var11[0]).append(" (Not loaded)");
var9.insert(Message.translation("server.npc.npcpath.nodes.waypointNotLoaded").param("index", var11[0]));
var11[0]++;
} else {
Vector3d var5 = var4x.getWaypointPosition(var3);
Rotation3f var6 = var4x.getWaypointRotation(var3);
var8.append("\n ").append('#').append(var4x.getOrder());
var8.append(" (").append(var5.x).append(", ").append(var5.y).append(", ").append(var5.z).append(')');
var8.append("\n ").append("Rotation: (").append(var6.x).append(", ").append(var6.y).append(", ").append(var6.z).append(')');
var8.append("\n ").append("Pause time: ").append(var4x.getPauseTime()).append('s');
var8.append("\n ").append(String.format("Observation angle: %.2f", var4x.getObservationAngle() * (180.0F / (float)Math.PI)));
var9.insert(
Message.translation("server.npc.npcpath.nodes.node")
.param("index", var4x.getOrder())
.param("posX", var5.x)
.param("posY", var5.y)
.param("posZ", var5.z)
.param("rotX", var6.x)
.param("rotY", var6.y)
.param("rotZ", var6.z)
.param("time", var4x.getPauseTime())
.param("angle", String.format("%.2f", var4x.getObservationAngle() * (180.0F / (float)Math.PI)))
);
var11[0]++;
}
}
);
PathPlugin.get().getLogger().at(Level.INFO).log("%s", var8.toString());
var1.sendMessage(var9);
}
}
}