EntitySnapshotLengthCommand class
Пакет: com.hypixel.hytale.server.core.command.commands.world.entity.snapshot
Файл: com/hypixel/hytale/server/core/command/commands/world/entity/snapshot/EntitySnapshotLengthCommand.java
extends: CommandBase
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
|
int |
var2 |
|
long |
var3 |
Методы (1)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
|
super super("length", "server.commands.entity.snapshot.length.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.command.commands.world.entity.snapshot;
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.modules.entity.system.SnapshotSystems;
class="kw">import java.util.concurrent.TimeUnit;
class="kw">import javax.annotation.Nonnull;
class="kw">public class EntitySnapshotLengthCommand class="kw">extends CommandBase {
@Nonnull
class="kw">private class="kw">final RequiredArg<Integer> lengthArg = this.withRequiredArg("length", "server.commands.entity.snapshot.length.length.desc", ArgTypes.INTEGER);
class="kw">public EntitySnapshotLengthCommand() {
super("length", "server.commands.entity.snapshot.length.desc");
}
@Override
class="kw">protected void executeSync(@Nonnull CommandContext var1) {
int var2 = this.lengthArg.get(var1);
SnapshotSystems.HISTORY_LENGTH_NS = TimeUnit.MILLISECONDS.toNanos(var2);
long var3 = TimeUnit.NANOSECONDS.toMillis(SnapshotSystems.HISTORY_LENGTH_NS);
var1.sendMessage(Message.translation("server.commands.entity.snapshot.lengthSet").param("millis", var3));
}
}