MountCheckCommand class

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

Файл: com/hypixel/hytale/builtin/mounts/commands/MountCheckCommand.java

extends: AbstractTargetPlayerCommand

Поля (2)

МодификаторыТипИмя
final Message MESSAGE_COMMANDS_CHECK_NO_COMPONENT
MountedComponent var7

Методы (2)

МодификаторыВозвратСигнатура
if if(var7 == null)
abstract super super("check", "server.commands.check.desc")

Исходный код

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

class="kw">import com.hypixel.hytale.builtin.mounts.MountedComponent;
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.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 MountCheckCommand class="kw">extends AbstractTargetPlayerCommand {
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_CHECK_NO_COMPONENT = Message.translation("server.commands.check.noComponent");
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_CHECK_MOUNTED_TO_ENTITY = Message.translation("server.commands.check.mountedToEntity");
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_CHECK_MOUNTED_TO_BLOCK = Message.translation("server.commands.check.mountedToBlock");
   class="kw">private class="kw">static class="kw">final Message MESSAGE_COMMANDS_CHECK_UNKNOWN_STATUS = Message.translation("server.commands.check.unknownStatus");

   class="kw">public MountCheckCommand() {
      super("check", "server.commands.check.desc");
      this.setPermissionGroups("hytale:Adventurer");
   }

   @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
   ) {
      MountedComponent var7 = var6.getComponent(var3, MountedComponent.getComponentType());
      if (var7 == null) {
         var4.sendMessage(MESSAGE_COMMANDS_CHECK_NO_COMPONENT);
      } else {
         if (var7.getMountedToEntity() != null) {
            var4.sendMessage(MESSAGE_COMMANDS_CHECK_MOUNTED_TO_ENTITY);
         } else if (var7.getMountedToBlock() != null) {
            var4.sendMessage(MESSAGE_COMMANDS_CHECK_MOUNTED_TO_BLOCK);
         } else {
            var4.sendMessage(MESSAGE_COMMANDS_CHECK_UNKNOWN_STATUS);
         }
      }
   }
}