PrefabPathNewCommand class

Пакет: com.hypixel.hytale.builtin.path.commands

Файл: com/hypixel/hytale/builtin/path/commands/PrefabPathNewCommand.java

extends: AbstractPlayerCommand

Поля (5)

МодификаторыТипИмя
Player var10
String var6
Double var7
Float var8
UUID var9

Методы (1)

МодификаторыВозвратСигнатура
abstract super super("new", "server.commands.npcpath.new.desc")

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.path.commands;

class="kw">import com.hypixel.hytale.builtin.buildertools.BuilderToolsPlugin;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
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.DefaultArg;
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.AbstractPlayerCommand;
class="kw">import com.hypixel.hytale.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
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.UUID;
class="kw">import javax.annotation.Nonnull;

class="kw">public class PrefabPathNewCommand class="kw">extends AbstractPlayerCommand {
   @Nonnull
   class="kw">private class="kw">final RequiredArg<String> pathNameArg = this.withRequiredArg("pathName", "server.commands.npcpath.new.pathName.desc", ArgTypes.STRING);
   @Nonnull
   class="kw">private class="kw">final DefaultArg<Double> pauseTimeArg = this.withDefaultArg("pauseTime", "server.commands.npcpath.new.pauseTime.desc", ArgTypes.DOUBLE, 0.0, "0.0");
   @Nonnull
   class="kw">private class="kw">final DefaultArg<Float> observationAngleArg = this.withDefaultArg(
      "observationAngleDegrees", "server.commands.npcpath.new.observationAngleDegrees.desc", ArgTypes.FLOAT, 0.0F, "0.0"
   );

   class="kw">public PrefabPathNewCommand() {
      super("new", "server.commands.npcpath.new.desc");
   }

   @Override
   class="kw">protected void execute(
      @Nonnull CommandContext var1, @Nonnull Store<EntityStore> var2, @Nonnull Ref<EntityStore> var3, @Nonnull PlayerRef var4, @Nonnull World var5
   ) {
      String var6 = this.pathNameArg.get(var1);
      Double var7 = this.pauseTimeArg.get(var1);
      Float var8 = this.observationAngleArg.get(var1);
      UUID var9 = UUID.randomUUID();
      Player var10 = var2.getComponent(var3, Player.getComponentType());
      assert var10 != null;
      PrefabPathHelper.addMarker(var2, var3, var9, var6, var7, var8, (short)-1, 0);
      BuilderToolsPlugin.getState(var10, var4).setActivePrefabPath(var9);
      var1.sendMessage(Message.translation("server.npc.npcpath.editingPath").param("path", var6));
   }
}