Class KingdomsCommand

java.lang.Object
org.kingdoms.commands.KingdomsCommand
Direct Known Subclasses:
AbstractCommandElectionVote, CommandAbstractTop, CommandAccept, CommandAdminBank, CommandAdminClaim, CommandAdminCommand, CommandAdminDailyChecks, CommandAdminDisband, CommandAdminEvaluate, CommandAdminHologram, CommandAdminHome, CommandAdminInfoPlayer, CommandAdminItemInject, CommandAdminItemResourcePoints, CommandAdminItemStructure, CommandAdminItemTurret, CommandAdminJoin, CommandAdminKick, CommandAdminLand, CommandAdminMasswar, CommandAdminMaxLandModifier, CommandAdminNationDisband, CommandAdminNexusLevel, CommandAdminNexusPlace, CommandAdminNexusTeleport, CommandAdminPacifism, CommandAdminPermanent, CommandAdminRank, CommandAdminRename, CommandAdminResourcePoints, CommandAdminShield, CommandAdminSound, CommandAdminSpy, CommandAdminTest, CommandAdminToggle, CommandAdminToggles, CommandAdminTrack, CommandAdminUnclaimAll, CommandAlly, CommandBookDiscard, CommandBookEdit, CommandBookOpen, CommandBookPreview, CommandBookRemove, CommandBookRename, CommandBroadcast, CommandChat, CommandClaimAuto, CommandClaimClipboard, CommandClaimConfirm, CommandClaimCorner, CommandClaimFill, CommandClaimLine, CommandClaimSquare, CommandColor, CommandCreate, CommandDecline, CommandDemote, CommandDisband, CommandDonate, CommandElectionRegister, CommandElectionStatement, CommandEnemy, CommandExtractor, CommandFly, CommandGlow, CommandHelp, CommandHome, CommandInvade, CommandInventory, CommandInvite, CommandInvites, CommandJoin, CommandKick, CommandKing, CommandLanguage, CommandLeave, CommandLore, CommandMailOpen, CommandMailReply, CommandMapSettings, CommandMute, CommandNationAccept, CommandNationBank, CommandNationBroadcast, CommandNationCapital, CommandNationCreate, CommandNationDecline, CommandNationDemote, CommandNationDisband, CommandNationElectionRegister, CommandNationElectionStatement, CommandNationInvite, CommandNationJoin, CommandNationKick, CommandNationLeave, CommandNationNexusOpen, CommandNationPromote, CommandNationRename, CommandNationRevoke, CommandNationSetSpawn, CommandNationShow, CommandNationShowPlayers, CommandNationSpawn, CommandNationTag, CommandNationUnsetspawn, CommandNexusOpen, CommandNexusRemove, CommandPromote, CommandPvP, CommandRedo, CommandRejectRelation, CommandRelations, CommandReload, CommandRename, CommandResourcePointsConverter, CommandResourcePointsDeposit, CommandResourcePointsTransferKingdom, CommandResourcePointsTransferNation, CommandResourcePointsWithdraw, CommandRevoke, CommandSell, CommandSetHome, CommandShield, CommandShow, CommandSneak, CommandSurrender, CommandTag, CommandTeleport, CommandTpa, CommandTpaAccept, CommandTpaReject, CommandTradable, CommandTruce, CommandUnclaimAll, CommandUnclaimAuto, CommandUndo, CommandUnmute, CommandUnsetHome, CommandUpdates, CommandVault, CommandVisualizeAll, CommandVisualizeMarkers, CommandVisualizePermanent, CommandVisualizeToggle, HandlerNationRel, KingdomsParentCommand

public abstract class KingdomsCommand extends Object
Note that both the command name (identifier) and displayname must be unique for all the commands.
  • Field Details

    • plugin

      protected static final Kingdoms plugin
    • permission

      protected @NonNull org.bukkit.permissions.Permission permission
    • bypassCooldownPermission

      protected @NonNull org.bukkit.permissions.Permission bypassCooldownPermission
    • bypassDisabledWorldsPermission

      protected @NonNull org.bukkit.permissions.Permission bypassDisabledWorldsPermission
    • name

      protected @NonNull String name
    • path

      protected String[] path
    • parent

      protected @Nullable KingdomsParentCommand parent
    • description

      protected @Nullable Messenger description
    • usage

      protected @Nullable Messenger usage
    • disabledWorlds

      protected @Nullable org.kingdoms.utils.internal.string.StringMatcher disabledWorlds
    • aliases

      protected @NonNull Map<org.kingdoms.locale.Language,List<String>> aliases
    • cooldown

      protected long cooldown
    • requiredArgs

      protected int requiredArgs
    • playerAssertion

      protected org.kingdoms.commands.annotations.CmdAssertPlayer playerAssertion
    • threadType

      protected org.kingdoms.server.thread.ThreadType threadType
  • Constructor Details

    • KingdomsCommand

      public KingdomsCommand()
      Annotation based constructor
    • KingdomsCommand

      public KingdomsCommand(@Pattern("[a-zA-Z0-9]+") @NonNull String name, @Nullable KingdomsParentCommand parent, org.bukkit.permissions.PermissionDefault permissionDefault)
    • KingdomsCommand

      public KingdomsCommand(@NonNull String name)
    • KingdomsCommand

      public KingdomsCommand(@NonNull String name, boolean playersCmd)
    • KingdomsCommand

      public KingdomsCommand(@Pattern("[a-zA-Z0-9]+") @NonNull String name, KingdomsParentCommand parent)
      The permission is inherited from the parent
  • Method Details

    • getAliases

      @NotNull public @Unmodifiable @NotNull Map<org.kingdoms.locale.Language,List<String>> getAliases()
    • setPermissionDefault

      public void setPermissionDefault(org.bukkit.permissions.PermissionDefault permissionDefault)
    • unregisterPermissions

      public void unregisterPermissions()
    • canBypassDisabledWorlds

      public boolean canBypassDisabledWorlds(org.bukkit.command.CommandSender sender)
    • canBypassCooldown

      public boolean canBypassCooldown(org.bukkit.command.CommandSender sender)
    • tabComplete

      @Deprecated public static List<String> tabComplete(String completion)
      Deprecated.
    • tabComplete

      @Deprecated public static List<String> tabComplete(String... completions)
      Deprecated.
    • tabComplete

      @Deprecated public static List<String> tabComplete(Collection<String> completions)
      Deprecated.
    • emptyTab

      @Deprecated protected static List<String> emptyTab()
      Deprecated.
    • getUsage

      public Messenger getUsage()
    • getDisabledWorlds

      public @Nullable org.kingdoms.utils.internal.string.StringMatcher getDisabledWorlds()
    • getCooldown

      public long getCooldown()
    • isDisabled

      protected boolean isDisabled()
    • getPermission

      public @NonNull org.bukkit.permissions.Permission getPermission()
    • hasPermission

      public boolean hasPermission(@NonNull org.bukkit.command.CommandSender sender)
    • hasPermission

      public boolean hasPermission(org.bukkit.command.CommandSender sender, String perm)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • lang

      @NotNull public @NotNull Messenger lang(String... path)
    • defaultedLang

      @NotNull public @NotNull Messenger defaultedLang(String defaultMessage, String... path)
    • getPath

      @NotNull public @NotNull String[] getPath()
    • configure

      @Experimental public void configure(@NonNull CommandContext context)
    • execute

      @NotNull public abstract @NotNull CommandResult execute(@NonNull CommandContext context)
    • tabComplete

      public @NonNull List<String> tabComplete(@NonNull CommandTabContext context)
    • getDisplayName

      public final @NonNull Messenger getDisplayName()
    • getName

      public final @NonNull String getName()
    • getParent

      public final @Nullable KingdomsParentCommand getParent()
    • getDescription

      public @Nullable Messenger getDescription()