EntityTrackerCommand class

Пакет: com.hypixel.hytale.server.core.command.commands.world.entity

Файл: com/hypixel/hytale/server/core/command/commands/world/entity/EntityTrackerCommand.java

extends: AbstractWorldCommand

Поля (4)

МодификаторыТипИмя
PlayerRef var4
Ref var5
EntityTrackerSystems.EntityViewer var6
Player var7

Методы (3)

МодификаторыВозвратСигнатура
if if(var6 == null)
if if(var7 == null)
abstract super super("tracker", "server.commands.entity.tracker.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.entity.entities.Player;
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 EntityTrackerCommand 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_TRACKER_NO_VIEWER_COMPONENT = Message.translation("server.commands.entity.tracker.noViewerComponent");
   @Nonnull
   class="kw">private class="kw">final RequiredArg<PlayerRef> playerArg = this.withRequiredArg("player", "server.commands.entity.tracker.player.desc", ArgTypes.PLAYER_REF);

   class="kw">public EntityTrackerCommand() {
      super("tracker", "server.commands.entity.tracker.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()) {
         EntityTrackerSystems.EntityViewer var6 = var3.getComponent(var5, EntityTrackerSystems.EntityViewer.getComponentType());
         if (var6 == null) {
            var1.sendMessage(MESSAGE_COMMANDS_ENTITY_TRACKER_NO_VIEWER_COMPONENT);
         } else {
            Player var7 = var3.getComponent(var5, Player.getComponentType());
            if (var7 == null) {
               var1.sendMessage(MESSAGE_COMMANDS_ERRORS_PLAYER_NOT_IN_WORLD);
            } else {
               var1.sendMessage(
                  Message.translation("server.commands.entityTracker.summary")
                     .param("visibleCount", var6.visible.size())
                     .param("lodExcludedCount", var6.lodExcludedCount)
                     .param("hiddenCount", var6.hiddenCount)
                     .param("totalCount", var6.visible.size() + var6.lodExcludedCount + var6.hiddenCount)
                     .param("worldTotalCount", var3.getEntityCount())
                     .param("viewRadius", var7.getViewRadius())
                     .param("viewRadiusBlocks", var6.viewRadiusBlocks)
               );
            }
         }
      } else {
         var1.sendMessage(MESSAGE_COMMANDS_ERRORS_PLAYER_NOT_IN_WORLD);
      }
   }
}