mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Renamed a lot of Command classes
This commit is contained in:
parent
57b7050a2c
commit
a9207b6f38
@ -5,11 +5,11 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class McabilityCommand extends ToggleCommand {
|
public class AbilityToggleCommand extends ToggleCommand {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McabilityCommand(mcMMO pluginRef) {
|
public AbilityToggleCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -11,11 +11,11 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class McnotifyCommand implements TabExecutor {
|
public class ChatNotificationToggleCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McnotifyCommand(mcMMO pluginRef) {
|
public ChatNotificationToggleCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -17,16 +17,16 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class McconvertCommand implements TabExecutor {
|
public class ConvertCommand implements TabExecutor {
|
||||||
private List<String> FORMULA_TYPES;
|
private List<String> FORMULA_TYPES;
|
||||||
private List<String> DATABASE_TYPES;
|
private List<String> DATABASE_TYPES;
|
||||||
private final List<String> SUBCOMMANDS = ImmutableList.of("database", "experience");
|
private final List<String> CONVERSION_SUBCOMMANDS = ImmutableList.of("database", "experience");
|
||||||
private CommandExecutor databaseConvertCommand;
|
private CommandExecutor databaseConvertCommand;
|
||||||
private CommandExecutor experienceConvertCommand;
|
private CommandExecutor experienceConvertCommand;
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McconvertCommand(mcMMO pluginRef) {
|
public ConvertCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
databaseConvertCommand = new ConvertDatabaseCommand(pluginRef);
|
databaseConvertCommand = new ConvertDatabaseCommand(pluginRef);
|
||||||
experienceConvertCommand = new ConvertExperienceCommand(pluginRef);
|
experienceConvertCommand = new ConvertExperienceCommand(pluginRef);
|
||||||
@ -79,7 +79,7 @@ public class McconvertCommand implements TabExecutor {
|
|||||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 1:
|
case 1:
|
||||||
return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<>(SUBCOMMANDS.size()));
|
return StringUtil.copyPartialMatches(args[0], CONVERSION_SUBCOMMANDS, new ArrayList<>(CONVERSION_SUBCOMMANDS.size()));
|
||||||
case 2:
|
case 2:
|
||||||
if (args[1].equalsIgnoreCase("database") || args[1].equalsIgnoreCase("db")) {
|
if (args[1].equalsIgnoreCase("database") || args[1].equalsIgnoreCase("db")) {
|
||||||
return StringUtil.copyPartialMatches(args[0], DATABASE_TYPES, new ArrayList<>(DATABASE_TYPES.size()));
|
return StringUtil.copyPartialMatches(args[0], DATABASE_TYPES, new ArrayList<>(DATABASE_TYPES.size()));
|
@ -14,11 +14,11 @@ import org.bukkit.util.StringUtil;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class XprateCommand implements TabExecutor {
|
public class ExperienceRateCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public XprateCommand(mcMMO pluginRef) {
|
public ExperienceRateCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -5,11 +5,11 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class McgodCommand extends ToggleCommand {
|
public class GodModeCommand extends ToggleCommand {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McgodCommand(mcMMO pluginRef) {
|
public GodModeCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -8,11 +8,11 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class McmmoCommand implements CommandExecutor {
|
public class McMMOCommand implements CommandExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McmmoCommand(mcMMO pluginRef) {
|
public McMMOCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -5,11 +5,11 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class McrefreshCommand extends ToggleCommand {
|
public class RefreshCooldownsCommand extends ToggleCommand {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McrefreshCommand(mcMMO pluginRef) {
|
public RefreshCooldownsCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -11,11 +11,11 @@ import org.bukkit.util.StringUtil;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class McscoreboardCommand implements TabExecutor {
|
public class ScoreboardCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McscoreboardCommand(mcMMO pluginRef) {
|
public ScoreboardCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -9,11 +9,11 @@ import org.bukkit.command.CommandSender;
|
|||||||
/**
|
/**
|
||||||
* @author Mark Vainomaa
|
* @author Mark Vainomaa
|
||||||
*/
|
*/
|
||||||
public final class McmmoReloadLocaleCommand implements CommandExecutor {
|
public final class ReloadLocaleCommand implements CommandExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McmmoReloadLocaleCommand(mcMMO pluginRef) {
|
public ReloadLocaleCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -2,10 +2,18 @@ package com.gmail.nossr50.commands.chat;
|
|||||||
|
|
||||||
import com.gmail.nossr50.commands.ToggleCommand;
|
import com.gmail.nossr50.commands.ToggleCommand;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class McChatSpy extends ToggleCommand {
|
public class ChatSpyCommand extends ToggleCommand {
|
||||||
|
|
||||||
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
|
public ChatSpyCommand(mcMMO pluginRef) {
|
||||||
|
this.pluginRef = pluginRef;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasOtherPermission(CommandSender sender) {
|
protected boolean hasOtherPermission(CommandSender sender) {
|
||||||
return Permissions.adminChatSpyOthers(sender);
|
return Permissions.adminChatSpyOthers(sender);
|
@ -8,11 +8,11 @@ import org.bukkit.command.TabExecutor;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class McpurgeCommand implements TabExecutor {
|
public class PurgeCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McpurgeCommand(mcMMO pluginRef) {
|
public PurgeCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -9,11 +9,11 @@ import org.bukkit.command.TabExecutor;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MmoshowdbCommand implements TabExecutor {
|
public class ShowDatabaseCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public MmoshowdbCommand(mcMMO pluginRef) {
|
public ShowDatabaseCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -8,9 +8,9 @@ import com.gmail.nossr50.util.Permissions;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class AddlevelsCommand extends ExperienceCommand {
|
public class AddLevelsCommand extends ExperienceCommand {
|
||||||
|
|
||||||
public AddlevelsCommand(mcMMO pluginRef) {
|
public AddLevelsCommand(mcMMO pluginRef) {
|
||||||
super(pluginRef);
|
super(pluginRef);
|
||||||
}
|
}
|
||||||
|
|
@ -4,12 +4,18 @@ import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
|||||||
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
||||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class AddxpCommand extends ExperienceCommand {
|
public class AddXPCommand extends ExperienceCommand {
|
||||||
|
|
||||||
|
public AddXPCommand(mcMMO pluginRef) {
|
||||||
|
super(pluginRef);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||||
return Permissions.addxp(sender);
|
return Permissions.addxp(sender);
|
@ -8,8 +8,8 @@ import com.gmail.nossr50.util.Permissions;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class MmoeditCommand extends ExperienceCommand {
|
public class SkillEditCommand extends ExperienceCommand {
|
||||||
public MmoeditCommand(mcMMO pluginRef) {
|
public SkillEditCommand(mcMMO pluginRef) {
|
||||||
super(pluginRef);
|
super(pluginRef);
|
||||||
}
|
}
|
||||||
|
|
@ -23,15 +23,15 @@ import java.util.UUID;
|
|||||||
* This class mirrors the structure of ExperienceCommand, except the
|
* This class mirrors the structure of ExperienceCommand, except the
|
||||||
* value/quantity argument is removed.
|
* value/quantity argument is removed.
|
||||||
*/
|
*/
|
||||||
public class SkillresetCommand implements TabExecutor {
|
public class SkillResetCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public SkillresetCommand(mcMMO pluginRef) {
|
public SkillResetCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
|
protected void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
|
||||||
if (skill == null) {
|
if (skill == null) {
|
||||||
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardAll.2", playerName));
|
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardAll.2", playerName));
|
||||||
} else {
|
} else {
|
@ -13,11 +13,11 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MccooldownCommand implements TabExecutor {
|
public class CooldownCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public MccooldownCommand(mcMMO pluginRef) {
|
public CooldownCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -20,11 +20,11 @@ import org.bukkit.util.StringUtil;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MctopCommand implements TabExecutor {
|
public class LeaderboardCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public MctopCommand(mcMMO pluginRef) {
|
public LeaderboardCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -18,11 +18,11 @@ import org.bukkit.util.StringUtil;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class McrankCommand implements TabExecutor {
|
public class RankCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McrankCommand(mcMMO pluginRef) {
|
public RankCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -11,11 +11,11 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class McstatsCommand implements TabExecutor {
|
public class SkillStatsCommand implements TabExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public McstatsCommand(mcMMO pluginRef) {
|
public SkillStatsCommand(mcMMO pluginRef) {
|
||||||
this.pluginRef = pluginRef;
|
this.pluginRef = pluginRef;
|
||||||
}
|
}
|
||||||
|
|
@ -9,11 +9,11 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class ReloadCommand implements CommandExecutor {
|
public class ReloadPluginCommand implements CommandExecutor {
|
||||||
|
|
||||||
private mcMMO pluginRef;
|
private mcMMO pluginRef;
|
||||||
|
|
||||||
public ReloadCommand(mcMMO plugin) {
|
public ReloadPluginCommand(mcMMO plugin) {
|
||||||
this.pluginRef = plugin;
|
this.pluginRef = plugin;
|
||||||
}
|
}
|
||||||
|
|
@ -206,6 +206,8 @@ public class mcMMO extends JavaPlugin {
|
|||||||
//Init Event Manager
|
//Init Event Manager
|
||||||
eventManager = new EventManager(this);
|
eventManager = new EventManager(this);
|
||||||
|
|
||||||
|
//Init Command Tools
|
||||||
|
//TODO: Better name?
|
||||||
commandTools = new CommandTools(this);
|
commandTools = new CommandTools(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ public class EventManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean tryLevelChangeEvent(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason) {
|
public boolean tryLevelChangeEvent(Player player, PrimarySkillType skill, int levelsChanged, double xpRemoved, boolean isLevelUp, XPGainReason xpGainReason) {
|
||||||
McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason);
|
McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason);
|
||||||
pluginRef.getServer().getPluginManager().callEvent(event);
|
pluginRef.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ public class EventManager {
|
|||||||
return isCancelled;
|
return isCancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean tryLevelEditEvent(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason, int oldLevel) {
|
public boolean tryLevelEditEvent(Player player, PrimarySkillType skill, int levelsChanged, double xpRemoved, boolean isLevelUp, XPGainReason xpGainReason, int oldLevel) {
|
||||||
McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged - oldLevel, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason);
|
McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged - oldLevel, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason);
|
||||||
pluginRef.getServer().getPluginManager().callEvent(event);
|
pluginRef.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
package com.gmail.nossr50.util.commands;
|
package com.gmail.nossr50.util.commands;
|
||||||
|
|
||||||
import com.gmail.nossr50.commands.*;
|
import com.gmail.nossr50.commands.*;
|
||||||
import com.gmail.nossr50.commands.admin.McmmoReloadLocaleCommand;
|
import com.gmail.nossr50.commands.admin.ReloadLocaleCommand;
|
||||||
import com.gmail.nossr50.commands.chat.AdminChatCommand;
|
import com.gmail.nossr50.commands.chat.AdminChatCommand;
|
||||||
import com.gmail.nossr50.commands.chat.McChatSpy;
|
import com.gmail.nossr50.commands.chat.ChatSpyCommand;
|
||||||
import com.gmail.nossr50.commands.chat.PartyChatCommand;
|
import com.gmail.nossr50.commands.chat.PartyChatCommand;
|
||||||
import com.gmail.nossr50.commands.database.McpurgeCommand;
|
import com.gmail.nossr50.commands.database.PurgeCommand;
|
||||||
import com.gmail.nossr50.commands.database.McremoveCommand;
|
import com.gmail.nossr50.commands.database.McremoveCommand;
|
||||||
import com.gmail.nossr50.commands.database.MmoshowdbCommand;
|
import com.gmail.nossr50.commands.database.ShowDatabaseCommand;
|
||||||
import com.gmail.nossr50.commands.experience.AddlevelsCommand;
|
import com.gmail.nossr50.commands.experience.AddLevelsCommand;
|
||||||
import com.gmail.nossr50.commands.experience.AddxpCommand;
|
import com.gmail.nossr50.commands.experience.AddXPCommand;
|
||||||
import com.gmail.nossr50.commands.experience.MmoeditCommand;
|
import com.gmail.nossr50.commands.experience.SkillEditCommand;
|
||||||
import com.gmail.nossr50.commands.experience.SkillresetCommand;
|
import com.gmail.nossr50.commands.experience.SkillResetCommand;
|
||||||
import com.gmail.nossr50.commands.party.PartyCommand;
|
import com.gmail.nossr50.commands.party.PartyCommand;
|
||||||
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
|
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
|
||||||
import com.gmail.nossr50.commands.player.*;
|
import com.gmail.nossr50.commands.player.*;
|
||||||
import com.gmail.nossr50.commands.server.ReloadCommand;
|
import com.gmail.nossr50.commands.server.ReloadPluginCommand;
|
||||||
import com.gmail.nossr50.commands.skills.*;
|
import com.gmail.nossr50.commands.skills.*;
|
||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
@ -120,7 +120,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.addlevels;mcmmo.commands.addlevels.others");
|
command.setPermission("mcmmo.commands.addlevels;mcmmo.commands.addlevels.others");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "addlevels", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Level") + ">"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "addlevels", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Level") + ">"));
|
||||||
command.setExecutor(new AddlevelsCommand());
|
command.setExecutor(new AddLevelsCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerAddxpCommand() {
|
private void registerAddxpCommand() {
|
||||||
@ -129,7 +129,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.addxp;mcmmo.commands.addxp.others");
|
command.setPermission("mcmmo.commands.addxp;mcmmo.commands.addxp.others");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "addxp", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.XP") + ">"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "addxp", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.XP") + ">"));
|
||||||
command.setExecutor(new AddxpCommand());
|
command.setExecutor(new AddXPCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcgodCommand() {
|
private void registerMcgodCommand() {
|
||||||
@ -138,7 +138,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcgod;mcmmo.commands.mcgod.others");
|
command.setPermission("mcmmo.commands.mcgod;mcmmo.commands.mcgod.others");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcgod", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcgod", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
||||||
command.setExecutor(new McgodCommand());
|
command.setExecutor(new GodModeCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMmoInfoCommand() {
|
private void registerMmoInfoCommand() {
|
||||||
@ -156,7 +156,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcchatspy;mcmmo.commands.mcchatspy.others");
|
command.setPermission("mcmmo.commands.mcchatspy;mcmmo.commands.mcchatspy.others");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcchatspy", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcchatspy", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
||||||
command.setExecutor(new McChatSpy());
|
command.setExecutor(new ChatSpyCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcrefreshCommand() {
|
private void registerMcrefreshCommand() {
|
||||||
@ -165,7 +165,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcrefresh;mcmmo.commands.mcrefresh.others");
|
command.setPermission("mcmmo.commands.mcrefresh;mcmmo.commands.mcrefresh.others");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcrefresh", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcrefresh", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
||||||
command.setExecutor(new McrefreshCommand());
|
command.setExecutor(new RefreshCooldownsCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMmoeditCommand() {
|
private void registerMmoeditCommand() {
|
||||||
@ -174,7 +174,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mmoedit;mcmmo.commands.mmoedit.others");
|
command.setPermission("mcmmo.commands.mmoedit;mcmmo.commands.mmoedit.others");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "mmoedit", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Level") + ">"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "mmoedit", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Level") + ">"));
|
||||||
command.setExecutor(new MmoeditCommand());
|
command.setExecutor(new SkillEditCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcmmoReloadCommand() {
|
private void registerMcmmoReloadCommand() {
|
||||||
@ -183,7 +183,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.reload");
|
command.setPermission("mcmmo.commands.reload");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcmmoreload"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcmmoreload"));
|
||||||
command.setExecutor(new ReloadCommand(pluginRef));
|
command.setExecutor(new ReloadPluginCommand(pluginRef));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerSkillresetCommand() {
|
private void registerSkillresetCommand() {
|
||||||
@ -192,7 +192,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.skillreset;mcmmo.commands.skillreset.others"); // Only need the main ones, not the individual skill ones
|
command.setPermission("mcmmo.commands.skillreset;mcmmo.commands.skillreset.others"); // Only need the main ones, not the individual skill ones
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "skillreset", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "skillreset", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + ">"));
|
||||||
command.setExecutor(new SkillresetCommand());
|
command.setExecutor(new SkillResetCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerXprateCommand() {
|
private void registerXprateCommand() {
|
||||||
@ -206,7 +206,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "xprate", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Rate") + ">", "<true|false>"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "xprate", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Rate") + ">", "<true|false>"));
|
||||||
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.1", "xprate", "reset"));
|
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.1", "xprate", "reset"));
|
||||||
command.setAliases(aliasList);
|
command.setAliases(aliasList);
|
||||||
command.setExecutor(new XprateCommand());
|
command.setExecutor(new ExperienceRateCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerInspectCommand() {
|
private void registerInspectCommand() {
|
||||||
@ -224,7 +224,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mccooldown");
|
command.setPermission("mcmmo.commands.mccooldown");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mccooldowns"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mccooldowns"));
|
||||||
command.setExecutor(new MccooldownCommand());
|
command.setExecutor(new CooldownCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcabilityCommand() {
|
private void registerMcabilityCommand() {
|
||||||
@ -233,7 +233,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcability;mcmmo.commands.mcability.others");
|
command.setPermission("mcmmo.commands.mcability;mcmmo.commands.mcability.others");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcability", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcability", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
||||||
command.setExecutor(new McabilityCommand());
|
command.setExecutor(new AbilityToggleCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcmmoCommand() {
|
private void registerMcmmoCommand() {
|
||||||
@ -243,7 +243,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcmmo"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcmmo"));
|
||||||
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcmmo", "help"));
|
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcmmo", "help"));
|
||||||
command.setExecutor(new McmmoCommand());
|
command.setExecutor(new McMMOCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcrankCommand() {
|
private void registerMcrankCommand() {
|
||||||
@ -252,7 +252,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcrank;mcmmo.commands.mcrank.others;mcmmo.commands.mcrank.others.far;mcmmo.commands.mcrank.others.offline");
|
command.setPermission("mcmmo.commands.mcrank;mcmmo.commands.mcrank.others;mcmmo.commands.mcrank.others.far;mcmmo.commands.mcrank.others.offline");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcrank", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcrank", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "]"));
|
||||||
command.setExecutor(new McrankCommand());
|
command.setExecutor(new RankCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcstatsCommand() {
|
private void registerMcstatsCommand() {
|
||||||
@ -261,7 +261,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcstats");
|
command.setPermission("mcmmo.commands.mcstats");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcstats"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcstats"));
|
||||||
command.setExecutor(new McstatsCommand());
|
command.setExecutor(new SkillStatsCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMctopCommand() {
|
private void registerMctopCommand() {
|
||||||
@ -270,7 +270,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mctop"); // Only need the main one, not the individual skill ones
|
command.setPermission("mcmmo.commands.mctop"); // Only need the main one, not the individual skill ones
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "mctop", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + "]", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Page") + "]"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "mctop", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Skill") + "]", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Page") + "]"));
|
||||||
command.setExecutor(new MctopCommand());
|
command.setExecutor(new LeaderboardCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcpurgeCommand() {
|
private void registerMcpurgeCommand() {
|
||||||
@ -279,7 +279,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcpurge");
|
command.setPermission("mcmmo.commands.mcpurge");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcpurge"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcpurge"));
|
||||||
command.setExecutor(new McpurgeCommand());
|
command.setExecutor(new PurgeCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcremoveCommand() {
|
private void registerMcremoveCommand() {
|
||||||
@ -297,7 +297,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mmoshowdb");
|
command.setPermission("mcmmo.commands.mmoshowdb");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mmoshowdb"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mmoshowdb"));
|
||||||
command.setExecutor(new MmoshowdbCommand());
|
command.setExecutor(new ShowDatabaseCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcconvertCommand() {
|
private void registerMcconvertCommand() {
|
||||||
@ -307,7 +307,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "mcconvert", "database", "<flatfile|sql>"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "mcconvert", "database", "<flatfile|sql>"));
|
||||||
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.2", "mcconvert", "experience", "<linear|exponential>"));
|
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.2", "mcconvert", "experience", "<linear|exponential>"));
|
||||||
command.setExecutor(new McconvertCommand());
|
command.setExecutor(new ConvertCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerAdminChatCommand() {
|
private void registerAdminChatCommand() {
|
||||||
@ -379,7 +379,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.mcnotify");
|
command.setPermission("mcmmo.commands.mcnotify");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcnotify"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcnotify"));
|
||||||
command.setExecutor(new McnotifyCommand());
|
command.setExecutor(new ChatNotificationToggleCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMHDCommand() {
|
private void registerMHDCommand() {
|
||||||
@ -398,7 +398,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcscoreboard", "<CLEAR | KEEP>"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "mcscoreboard", "<CLEAR | KEEP>"));
|
||||||
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.2", "mcscoreboard", "time", "<seconds>"));
|
command.setUsage(command.getUsage() + "\n" + pluginRef.getLocaleManager().getString("Commands.Usage.2", "mcscoreboard", "time", "<seconds>"));
|
||||||
command.setExecutor(new McscoreboardCommand());
|
command.setExecutor(new ScoreboardCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerMcImportCommand() {
|
private void registerMcImportCommand() {
|
||||||
@ -416,7 +416,7 @@ public final class CommandRegistrationManager {
|
|||||||
command.setPermission("mcmmo.commands.reloadlocale");
|
command.setPermission("mcmmo.commands.reloadlocale");
|
||||||
command.setPermissionMessage(permissionsMessage);
|
command.setPermissionMessage(permissionsMessage);
|
||||||
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcmmoreloadlocale"));
|
command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mcmmoreloadlocale"));
|
||||||
command.setExecutor(new McmmoReloadLocaleCommand());
|
command.setExecutor(new ReloadLocaleCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerCommands() {
|
public void registerCommands() {
|
||||||
|
@ -61,15 +61,6 @@ public final class CommandTools {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOffline(CommandSender sender, OfflinePlayer player) {
|
|
||||||
if (player.isOnline()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Offline"));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if there is a valid mcMMOPlayer object.
|
* Checks if there is a valid mcMMOPlayer object.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user