PrefabEditSaveUICommand class

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

Файл: com/hypixel/hytale/builtin/buildertools/prefabeditor/commands/PrefabEditSaveUICommand.java

extends: AbstractPlayerCommand

Поля (3)

МодификаторыТипИмя
PrefabEditSessionManager var6
PrefabEditSession var7
Player var8

Методы (2)

МодификаторыВозвратСигнатура
if if(var7 == null)
abstract super super("saveui", "server.commands.editprefab.saveui.desc")

Исходный код

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

class="kw">import com.hypixel.hytale.builtin.buildertools.BuilderToolsPlugin;
class="kw">import com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditSession;
class="kw">import com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditSessionManager;
class="kw">import com.hypixel.hytale.builtin.buildertools.prefabeditor.ui.PrefabEditorSaveSettingsPage;
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.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 javax.annotation.Nonnull;

class="kw">public class PrefabEditSaveUICommand class="kw">extends AbstractPlayerCommand {
   @Nonnull
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_EDIT_PREFAB_NOT_IN_EDIT_SESSION = Message.translation("server.commands.editprefab.notInEditSession");
   @Nonnull
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_EDIT_PREFAB_NO_PREFABS_LOADED = Message.translation("server.commands.editprefab.save.noPrefabsLoaded");
   @Nonnull
   class="kw">private class="kw">static class="kw">final Message MESSAGE_NOT_IN_EDIT_WORLD = Message.translation("server.commands.editprefab.notInEditWorldWarning");

   class="kw">public PrefabEditSaveUICommand() {
      super("saveui", "server.commands.editprefab.saveui.desc");
   }

   @Override
   class="kw">protected void execute(
      @Nonnull CommandContext var1, @Nonnull Store<EntityStore> var2, @Nonnull Ref<EntityStore> var3, @Nonnull PlayerRef var4, @Nonnull World var5
   ) {
      PrefabEditSessionManager var6 = BuilderToolsPlugin.get().getPrefabEditSessionManager();
      PrefabEditSession var7 = var6.getPrefabEditSession(var4.getUuid());
      if (var7 == null) {
         var1.sendMessage(MESSAGE_COMMANDS_EDIT_PREFAB_NOT_IN_EDIT_SESSION);
      } else if (var7.getLoadedPrefabMetadata().isEmpty()) {
         var1.sendMessage(MESSAGE_COMMANDS_EDIT_PREFAB_NO_PREFABS_LOADED);
      } else if (!var6.isInEditWorld(var4, var2)) {
         var1.sendMessage(MESSAGE_NOT_IN_EDIT_WORLD);
      } else {
         Player var8 = var2.getComponent(var3, Player.getComponentType());
         assert var8 != null;
         var8.getPageManager().openCustomPage(var3, var2, new PrefabEditorSaveSettingsPage(var4, var7));
      }
   }
}