SetPatchlineVariant class
Пакет: com.hypixel.hytale.server.core.update.command
Файл: com/hypixel/hytale/server/core/update/command/UpdatePatchlineCommand.java
extends: CommandBase
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
private final RequiredArg<String> |
patchlineArg |
|
String |
var2 |
|
UpdateConfig |
var3 |
Методы (2)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
protected void |
executeSyncprotected void executeSync(@Nonnull CommandContext var1) |
abstract |
|
super super("server.commands.update.patchline.set.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.update.command;
class="kw">import com.hypixel.hytale.server.core.HytaleServer;
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.RequiredArg;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
class="kw">import com.hypixel.hytale.server.core.command.system.basecommands.CommandBase;
class="kw">import com.hypixel.hytale.server.core.config.UpdateConfig;
class="kw">import com.hypixel.hytale.server.core.update.UpdateService;
class="kw">import javax.annotation.Nonnull;
class="kw">public class UpdatePatchlineCommand class="kw">extends CommandBase {
class="kw">public UpdatePatchlineCommand() {
super("patchline", "server.commands.update.patchline.desc");
this.addUsageVariant(new UpdatePatchlineCommand.SetPatchlineVariant());
}
@Override
class="kw">protected void executeSync(@Nonnull CommandContext var1) {
String var2 = UpdateService.getEffectivePatchline();
var1.sendMessage(Message.translation("server.commands.update.patchline.current").param("patchline", var2));
}
class="kw">private class="kw">static class SetPatchlineVariant class="kw">extends CommandBase {
@Nonnull
class="kw">private class="kw">final RequiredArg<String> patchlineArg = this.withRequiredArg("patchline", "server.commands.update.patchline.arg.desc", ArgTypes.STRING);
SetPatchlineVariant() {
super("server.commands.update.patchline.set.desc");
}
@Override
class="kw">protected void executeSync(@Nonnull CommandContext var1) {
String var2 = this.patchlineArg.get(var1);
UpdateConfig var3 = HytaleServer.get().getConfig().getUpdateConfig();
var3.setPatchline(var2);
var1.sendMessage(Message.translation("server.commands.update.patchline.changed").param("patchline", var2));
}
}
}