PlayerLivesGetCommand class
Пакет: com.hypixel.hytale.server.core.command.commands.player.lives
Файл: com/hypixel/hytale/server/core/command/commands/player/lives/PlayerLivesGetCommand.java
extends: AbstractTargetPlayerCommand
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
|
PlayerLives |
var7 |
Методы (2)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
if if(var7 != null) |
abstract |
|
super super("get", "server.commands.player.lives.get.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.command.commands.player.lives;
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.AbstractTargetPlayerCommand;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.PlayerLives;
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">import javax.annotation.Nullable;
class="kw">public class PlayerLivesGetCommand class="kw">extends AbstractTargetPlayerCommand {
class="kw">public PlayerLivesGetCommand() {
super("get", "server.commands.player.lives.get.desc");
}
@Override
class="kw">protected void execute(
@Nonnull CommandContext var1,
@Nullable Ref<EntityStore> var2,
@Nonnull Ref<EntityStore> var3,
@Nonnull PlayerRef var4,
@Nonnull World var5,
@Nonnull Store<EntityStore> var6
) {
PlayerLives var7 = var6.getComponent(var3, PlayerLives.getComponentType());
if (var7 != null) {
var1.sendMessage(
Message.translation("server.commands.player.lives.info").param("username", var4.getUsername()).param("remaining", var7.getRemaining())
);
} else {
var1.sendMessage(Message.translation("server.commands.player.lives.none").param("username", var4.getUsername()));
}
}
}