DebugShapeArrowCommand class

Пакет: com.hypixel.hytale.server.core.modules.debug.commands

Файл: com/hypixel/hytale/server/core/modules/debug/commands/DebugShapeArrowCommand.java

extends: AbstractPlayerCommand

Поля (12)

МодификаторыТипИмя
Rotation3f var10
float var11
float var12
float var13
ThreadLocalRandom var14
Vector3f var15
Matrix4d var16
int var17
Player var6
TransformComponent var7
Vector3d var8
HeadRotation var9

Методы (1)

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

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.debug.commands;

class="kw">import com.hypixel.hytale.component.Ref;
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.FlagArg;
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.modules.debug.DebugUtils;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.HeadRotation;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.ModelComponent;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
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.concurrent.ThreadLocalRandom;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Matrix4d;
class="kw">import org.joml.Vector3d;
class="kw">import org.joml.Vector3f;

class="kw">public class DebugShapeArrowCommand class="kw">extends AbstractPlayerCommand {
   @Nonnull
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_DEBUG_SHAPE_ARROW_SUCCESS = Message.translation("server.commands.debug.shape.arrow.success");
   @Nonnull
   class="kw">private class="kw">final FlagArg fadeFlag = this.withFlagArg("fade", "server.commands.debug.shape.flag.fade.desc");
   @Nonnull
   class="kw">private class="kw">final FlagArg noWireframeFlag = this.withFlagArg("no-wireframe", "server.commands.debug.shape.flag.noWireframe.desc");
   @Nonnull
   class="kw">private class="kw">final FlagArg noSolidFlag = this.withFlagArg("no-solid", "server.commands.debug.shape.flag.noSolid.desc");

   class="kw">public DebugShapeArrowCommand() {
      super("arrow", "server.commands.debug.shape.arrow.desc");
   }

   @Override
   class="kw">protected void execute(
      @Nonnull CommandContext var1, @Nonnull Store<EntityStore> var2, @Nonnull Ref<EntityStore> var3, @Nonnull PlayerRef var4, @Nonnull World var5
   ) {
      Player var6 = var2.getComponent(var3, Player.getComponentType());
      assert var6 != null;
      TransformComponent var7 = var2.getComponent(var3, TransformComponent.getComponentType());
      assert var7 != null;
      Vector3d var8 = var7.getPosition();
      HeadRotation var9 = var2.getComponent(var3, HeadRotation.getComponentType());
      assert var9 != null;
      Rotation3f var10 = var9.getRotation();
      float var11 = var10.yaw();
      float var12 = var10.pitch();
      float var13 = ModelComponent.getEyeHeight(var3, var2);
      ThreadLocalRandom var14 = ThreadLocalRandom.current();
      Vector3f var15 = new Vector3f(var14.nextFloat(), var14.nextFloat(), var14.nextFloat());
      Matrix4d var16 = new Matrix4d();
      var16.identity();
      var16.translate(var8.x, var8.y + var13, var8.z);
      var16.rotate(var11, 0.0, 1.0, 0.0);
      var16.rotate(-((Math.PI / 2) - var12), 1.0, 0.0, 0.0);
      int var17 = DebugShapeSubCommand.buildFlags(var1, this.fadeFlag, this.noWireframeFlag, this.noSolidFlag);
      DebugUtils.addArrow(var5, var16, var15, 1.0, 30.0F, var17);
      var1.sendMessage(MESSAGE_COMMANDS_DEBUG_SHAPE_ARROW_SUCCESS);
   }
}