Class PartyCommand

    • Field Detail

      • mainConfig

        public static org.bukkit.configuration.file.FileConfiguration mainConfig
        PartyChat's main config file.
      • cooldownMap

        public static Map<org.bukkit.entity.Player,​Map<PartyCommand,​Cooldown>> cooldownMap
        Map in a map for cooldown storage.
    • Constructor Detail

      • PartyCommand

        protected PartyCommand​(String name,
                               String usage,
                               String description,
                               boolean requiresLeader,
                               boolean disabled,
                               int cooldown,
                               List<String> aliases)
    • Method Detail

      • execute

        public abstract boolean execute​(org.bukkit.entity.Player player,
                                        String[] args,
                                        boolean leftServer)
      • reload

        public static void reload()
        Refresh the main PartyChat config object used in this class and subclasses.
      • onCommand

        public boolean onCommand​(@NotNull
                                 @NotNull org.bukkit.command.CommandSender sender,
                                 @NotNull
                                 @NotNull org.bukkit.command.Command command,
                                 @NotNull
                                 @NotNull String label,
                                 @NotNull
                                 @NotNull String[] args)
        Handle all of the /party command and subcommands.
        Specified by:
        onCommand in interface org.bukkit.command.CommandExecutor
        Parameters:
        sender - The command's sender. In this method we only accept a Player.
        command - The command itself.
        label - The command's label.
        args - The command arguments.
        Returns:
        True/False just to make Bukkit happy.
      • onTabComplete

        public List<String> onTabComplete​(@NotNull
                                          @NotNull org.bukkit.command.CommandSender sender,
                                          @NotNull
                                          @NotNull org.bukkit.command.Command command,
                                          @NotNull
                                          @NotNull String alias,
                                          @NotNull
                                          @NotNull String[] args)
                                   throws IllegalArgumentException
        Tab completion for /party command and subcommands.
        Specified by:
        onTabComplete in interface org.bukkit.command.TabCompleter
        Parameters:
        sender - The command's sender.
        command - The command itself.
        alias - The command's alias.
        args - The command arguments.
        Returns:
        A list of strings to show the sender.
        Throws:
        IllegalArgumentException - Allows for returning Collections.emptyList().
      • canUse

        public boolean canUse​(org.bukkit.entity.Player player)
        Check if a player can use a certain subcommand. This will check to see if the command requires the player be the party leader, if the command is still on cooldown, and if the command is disabled.
        Parameters:
        player - The player running the subcommand.
        Returns:
        Whether or not the player may use the subcommand.
      • runTaskLater

        public static void runTaskLater​(int delay,
                                        Runnable task)
      • getName

        public String getName()
      • getUsage

        public String getUsage()
      • getDescription

        public String getDescription()
      • requiresLeader

        public boolean requiresLeader()
      • anyoneCanUse

        public boolean anyoneCanUse()
      • getCooldown

        public int getCooldown()
      • setCooldown

        public void setCooldown​(int cooldown)
      • isDisabled

        public boolean isDisabled()
      • isEnabled

        public boolean isEnabled()
      • setDisabled

        public void setDisabled​(boolean disabled)
      • getConfigBoolean

        public static boolean getConfigBoolean​(String path)
      • getSubCommandUsage

        public static String getSubCommandUsage​(String command)
      • getSubCommandDescription

        public static String getSubCommandDescription​(String command)
      • getSubCommandDisabled

        public static boolean getSubCommandDisabled​(String command)
      • getSubCommandCooldown

        public static int getSubCommandCooldown​(String command)
      • getSubCommandAliases

        public static List<String> getSubCommandAliases​(String command)