ObjectiveHistoryCommand class

Пакет: com.hypixel.hytale.builtin.adventure.objectives.commands

Файл: com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveHistoryCommand.java

extends: AbstractPlayerCommand

Поля (4)

МодификаторыТипИмя
Map var12
StringBuilder var6
ObjectiveHistoryComponent var7
Map var8

Методы (1)

МодификаторыВозвратСигнатура
abstract super super("history", "server.commands.objective.history")

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.adventure.objectives.commands;

class="kw">import com.hypixel.hytale.builtin.adventure.objectives.ObjectivePlugin;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.components.ObjectiveHistoryComponent;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.historydata.ObjectiveHistoryData;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.historydata.ObjectiveLineHistoryData;
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.AbstractPlayerCommand;
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 java.util.Map;
class="kw">import javax.annotation.Nonnull;

class="kw">public class ObjectiveHistoryCommand class="kw">extends AbstractPlayerCommand {
   class="kw">public ObjectiveHistoryCommand() {
      super("history", "server.commands.objective.history");
   }

   @Override
   class="kw">protected void execute(
      @Nonnull CommandContext var1, @Nonnull Store<EntityStore> var2, @Nonnull Ref<EntityStore> var3, @Nonnull PlayerRef var4, @Nonnull World var5
   ) {
      StringBuilder var6 = new StringBuilder("Completed objectives\n");
      ObjectiveHistoryComponent var7 = var2.getComponent(var3, ObjectivePlugin.get().getObjectiveHistoryComponentType());
      assert var7 != null;
      Map var8 = var7.getObjectiveHistoryMap();

      for (ObjectiveHistoryData var10 : var8.values()) {
         var6.append(var10).append("\n");
      }

      var6.append("\nCompleted objective lines\n");
      Map var12 = var7.getObjectiveLineHistoryMap();

      for (ObjectiveLineHistoryData var11 : var12.values()) {
         var6.append(var11).append("\n");
      }

      var1.sendMessage(Message.raw(var6.toString()));
   }
}