PrefabEditInfoCommand class
Пакет: com.hypixel.hytale.builtin.buildertools.prefabeditor.commands
Файл: com/hypixel/hytale/builtin/buildertools/prefabeditor/commands/PrefabEditInfoCommand.java
extends: AbstractPlayerCommand
Поля (10)
| Модификаторы | Тип | Имя |
|---|---|---|
|
PrefabEditingMetadata |
var10 |
|
Vector3i |
var11 |
|
Vector3i |
var12 |
|
int |
var13 |
|
int |
var14 |
|
int |
var15 |
|
UUIDComponent |
var6 |
|
UUID |
var7 |
|
PrefabEditSessionManager |
var8 |
|
PrefabEditSession |
var9 |
Методы (3)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
if if(var9 == null) |
|
|
if if(var10 == null) |
abstract |
|
super super("info", "server.commands.editprefab.info.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.PrefabEditingMetadata;
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.UUIDComponent;
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">import org.joml.Vector3i;
class="kw">public class PrefabEditInfoCommand 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_PREFAB_SELECTED = Message.translation("server.commands.editprefab.noPrefabSelected");
class="kw">public PrefabEditInfoCommand() {
super("info", "server.commands.editprefab.info.desc");
}
@Override
class="kw">protected void execute(
@Nonnull CommandContext var1, @Nonnull Store<EntityStore> var2, @Nonnull Ref<EntityStore> var3, @Nonnull PlayerRef var4, @Nonnull World var5
) {
UUIDComponent var6 = var2.getComponent(var3, UUIDComponent.getComponentType());
assert var6 != null;
UUID var7 = var6.getUuid();
PrefabEditSessionManager var8 = BuilderToolsPlugin.get().getPrefabEditSessionManager();
PrefabEditSession var9 = var8.getPrefabEditSession(var7);
if (var9 == null) {
var1.sendMessage(MESSAGE_COMMANDS_EDIT_PREFAB_NOT_IN_EDIT_SESSION);
} else {
PrefabEditingMetadata var10 = var9.getSelectedPrefab(var7);
if (var10 == null) {
var1.sendMessage(MESSAGE_COMMANDS_EDIT_PREFAB_NO_PREFAB_SELECTED);
} else {
Vector3i var11 = var10.getMinPoint();
Vector3i var12 = var10.getMaxPoint();
int var13 = var12.x() - var11.x();
int var14 = var12.z() - var11.z();
int var15 = var12.y() - var11.y();
var1.sendMessage(
Message.translation("server.commands.editprefab.info.format")
.param("path", var10.getPrefabPath().toString())
.param("dimensions", "X: " + var13 + ", Y: " + var15 + ", Z: " + var14)
.param(
"dirty",
var10.isDirty()
? Message.translation("server.commands.editprefab.info.dirty.yes")
: Message.translation("server.commands.editprefab.info.dirty.no")
)
);
}
}
}
}