PrefabEditTeleportCommand class
Пакет: com.hypixel.hytale.builtin.buildertools.prefabeditor.commands
Файл: com/hypixel/hytale/builtin/buildertools/prefabeditor/commands/PrefabEditTeleportCommand.java
extends: AbstractPlayerCommand
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
PrefabEditSessionManager |
var6 |
|
PrefabEditSession |
var7 |
|
Player |
var8 |
Методы (2)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
if if(var7 == null) |
abstract |
|
super super("tp", "server.commands.editprefab.tp.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.PrefabTeleportPage;
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 PrefabEditTeleportCommand 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.tp.noPrefabsLoaded");
class="kw">public PrefabEditTeleportCommand() {
super("tp", "server.commands.editprefab.tp.desc");
this.addAliases("teleport");
}
@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 {
Player var8 = var2.getComponent(var3, Player.getComponentType());
assert var8 != null;
var8.getPageManager().openCustomPage(var3, var2, new PrefabTeleportPage(var4, var7));
}
}
}