DebugShapeCylinderCommand class

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

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

extends: AbstractPlayerCommand

Поля (5)

МодификаторыТипИмя
int var10
TransformComponent var6
Vector3d var7
ThreadLocalRandom var8
Vector3f var9

Методы (1)

МодификаторыВозвратСигнатура
abstract super super("cylinder", "server.commands.debug.shape.cylinder.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.protocol.DebugShape;
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.modules.debug.DebugUtils;
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.Vector3d;
class="kw">import org.joml.Vector3f;

class="kw">public class DebugShapeCylinderCommand class="kw">extends AbstractPlayerCommand {
   @Nonnull
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_DEBUG_SHAPE_CYLINDER_SUCCESS = Message.translation("server.commands.debug.shape.cylinder.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 DebugShapeCylinderCommand() {
      super("cylinder", "server.commands.debug.shape.cylinder.desc");
   }

   @Override
   class="kw">protected void execute(
      @Nonnull CommandContext var1, @Nonnull Store<EntityStore> var2, @Nonnull Ref<EntityStore> var3, @Nonnull PlayerRef var4, @Nonnull World var5
   ) {
      TransformComponent var6 = var2.getComponent(var3, TransformComponent.getComponentType());
      assert var6 != null;
      Vector3d var7 = var6.getPosition();
      ThreadLocalRandom var8 = ThreadLocalRandom.current();
      Vector3f var9 = new Vector3f(var8.nextFloat(), var8.nextFloat(), var8.nextFloat());
      int var10 = DebugShapeSubCommand.buildFlags(var1, this.fadeFlag, this.noWireframeFlag, this.noSolidFlag);
      DebugUtils.add(var5, DebugShape.Cylinder, DebugUtils.makeMatrix(var7, 2.0), var9, 30.0F, var10);
      var1.sendMessage(MESSAGE_COMMANDS_DEBUG_SHAPE_CYLINDER_SUCCESS);
   }
}