EntityResendCommand class
Пакет: com.hypixel.hytale.server.core.command.commands.world.entity
Файл: com/hypixel/hytale/server/core/command/commands/world/entity/EntityResendCommand.java
extends: AbstractWorldCommand
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
|
PlayerRef |
var4 |
|
Ref |
var5 |
Методы (1)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
|
super super("resend", "server.commands.entity.resend.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.command.commands.world.entity;
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.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.AbstractWorldCommand;
class="kw">import com.hypixel.hytale.server.core.modules.entity.tracker.EntityTrackerSystems;
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 EntityResendCommand class="kw">extends AbstractWorldCommand {
@Nonnull
class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_ERRORS_PLAYER_NOT_IN_WORLD = Message.translation("server.commands.errors.playerNotInWorld");
@Nonnull
class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_ENTITY_RESET_NO_ENTITY_VIEWER_COMPONENT = Message.translation(
"server.commands.entity.resend.noEntityViewerComponent"
);
@Nonnull
class="kw">private class="kw">final RequiredArg<PlayerRef> playerArg = this.withRequiredArg("player", "server.commands.entity.resend.player.desc", ArgTypes.PLAYER_REF);
class="kw">public EntityResendCommand() {
super("resend", "server.commands.entity.resend.desc");
}
@Override
class="kw">protected void execute(@Nonnull CommandContext var1, @Nonnull World var2, @Nonnull Store<EntityStore> var3) {
PlayerRef var4 = this.playerArg.get(var1);
Ref var5 = var4.getReference();
if (var5 != null && var5.isValid()) {
if (!EntityTrackerSystems.despawnAll(var5, var3)) {
var1.sendMessage(MESSAGE_COMMANDS_ENTITY_RESET_NO_ENTITY_VIEWER_COMPONENT);
}
} else {
var1.sendMessage(MESSAGE_COMMANDS_ERRORS_PLAYER_NOT_IN_WORLD);
}
}
}