mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Removal of alias variables and update of all commands
This commit is contained in:
parent
50af20037a
commit
f937e44018
@ -62,7 +62,7 @@ public class AddxpCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length < 2) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /" + LoadProperties.addxp + " playername skillname xp");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addxp playername skillname xp");
|
||||
return true;
|
||||
}
|
||||
if (args.length == 3) {
|
||||
@ -78,7 +78,7 @@ public class AddxpCommand implements CommandExecutor {
|
||||
Users.getProfile(player).addXP(Skills.getSkillType(args[0]), newvalue, player);
|
||||
player.sendMessage(ChatColor.RED + args[0] + " has been modified.");
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /" + LoadProperties.addxp + " playername skillname xp");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addxp playername skillname xp");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -36,7 +36,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
if (args.length < 2) {
|
||||
System.out.println("Usage is /" + LoadProperties.mmoedit + " playername skillname newvalue");
|
||||
System.out.println("Usage is /mmoedit playername skillname newvalue");
|
||||
return true;
|
||||
} else if (args.length == 3) {
|
||||
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
|
||||
@ -45,7 +45,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
System.out.println(args[1] + " has been modified for " + plugin.getServer().getPlayer(args[0]).getName() + ".");
|
||||
}
|
||||
} else {
|
||||
System.out.println("Usage is /" + LoadProperties.mmoedit + " playername skillname newvalue");
|
||||
System.out.println("Usage is /mmoedit playername skillname newvalue");
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -59,7 +59,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length < 2) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /" + LoadProperties.mmoedit + " playername skillname newvalue");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /mmoedit playername skillname newvalue");
|
||||
return true;
|
||||
}
|
||||
if (args.length == 3) {
|
||||
@ -75,7 +75,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
player.sendMessage(ChatColor.RED + args[0] + " has been modified.");
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /" + LoadProperties.mmoedit + " playername skillname newvalue");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /mmoedit playername skillname newvalue");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -38,7 +38,7 @@ public class WhoisCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (args.length < 1) {
|
||||
player.sendMessage(ChatColor.RED + "Proper usage is /" + LoadProperties.whois + " <playername>");
|
||||
player.sendMessage(ChatColor.RED + "Proper usage is /whois <playername>");
|
||||
return true;
|
||||
}
|
||||
// if split[1] is a player
|
||||
|
@ -27,8 +27,8 @@ public class XprateCommand implements CommandExecutor {
|
||||
if (!(sender instanceof Player)) {
|
||||
if(args.length <= 0)
|
||||
{
|
||||
System.out.println(mcLocale.getString("Commands.xprate.proper", new Object[] {LoadProperties.xprate}));
|
||||
System.out.println(mcLocale.getString("Commands.xprate.proper2", new Object[] {LoadProperties.xprate}));
|
||||
System.out.println(mcLocale.getString("Commands.xprate.proper", new Object[] {"/xprate"}));
|
||||
System.out.println(mcLocale.getString("Commands.xprate.proper2", new Object[] {"/xprate"}));
|
||||
}
|
||||
|
||||
if(args.length == 1 && args[0].equalsIgnoreCase("reset"))
|
||||
@ -81,8 +81,8 @@ public class XprateCommand implements CommandExecutor {
|
||||
}
|
||||
if(args.length <= 0)
|
||||
{
|
||||
player.sendMessage(mcLocale.getString("Commands.xprate.proper", new Object[] {LoadProperties.xprate}));
|
||||
player.sendMessage(mcLocale.getString("Commands.xprate.proper2", new Object[] {LoadProperties.xprate}));
|
||||
player.sendMessage(mcLocale.getString("Commands.xprate.proper", new Object[] {"/xprate"}));
|
||||
player.sendMessage(mcLocale.getString("Commands.xprate.proper2", new Object[] {"/xprate"}));
|
||||
}
|
||||
if(args.length == 1 && args[0].equalsIgnoreCase("reset"))
|
||||
{
|
||||
|
@ -29,44 +29,44 @@ public class MccCommand implements CommandExecutor {
|
||||
|
||||
if (mcPermissions.getInstance().party(player)) {
|
||||
player.sendMessage(mcLocale.getString("m.mccPartyCommands"));
|
||||
player.sendMessage(LoadProperties.party + " " + mcLocale.getString("m.mccParty"));
|
||||
player.sendMessage(LoadProperties.party + " q " + mcLocale.getString("m.mccPartyQ"));
|
||||
player.sendMessage("/party " + mcLocale.getString("m.mccParty"));
|
||||
player.sendMessage("/party q " + mcLocale.getString("m.mccPartyQ"));
|
||||
|
||||
if (mcPermissions.getInstance().partyChat(player))
|
||||
player.sendMessage("/p " + mcLocale.getString("m.mccPartyToggle"));
|
||||
|
||||
player.sendMessage(LoadProperties.invite + " " + mcLocale.getString("m.mccPartyInvite"));
|
||||
player.sendMessage(LoadProperties.accept + " " + mcLocale.getString("m.mccPartyAccept"));
|
||||
player.sendMessage("/invite " + mcLocale.getString("m.mccPartyInvite"));
|
||||
player.sendMessage("/invite " + mcLocale.getString("m.mccPartyAccept"));
|
||||
|
||||
if (mcPermissions.getInstance().partyTeleport(player))
|
||||
player.sendMessage(LoadProperties.ptp + " " + mcLocale.getString("m.mccPartyTeleport"));
|
||||
player.sendMessage("/ptp " + mcLocale.getString("m.mccPartyTeleport"));
|
||||
}
|
||||
player.sendMessage(mcLocale.getString("m.mccOtherCommands"));
|
||||
player.sendMessage(LoadProperties.stats + ChatColor.RED + " " + mcLocale.getString("m.mccStats"));
|
||||
player.sendMessage("/stats " + ChatColor.RED + " " + mcLocale.getString("m.mccStats"));
|
||||
player.sendMessage("/mctop <skillname> <page> " + ChatColor.RED + mcLocale.getString("m.mccLeaderboards"));
|
||||
|
||||
if (mcPermissions.getInstance().mySpawn(player)) {
|
||||
player.sendMessage(LoadProperties.myspawn + " " + ChatColor.RED + mcLocale.getString("m.mccMySpawn"));
|
||||
player.sendMessage(LoadProperties.clearmyspawn + " " + ChatColor.RED + mcLocale.getString("m.mccClearMySpawn"));
|
||||
player.sendMessage("/myspawn " + ChatColor.RED + mcLocale.getString("m.mccMySpawn"));
|
||||
player.sendMessage("/clearmyspawn " + ChatColor.RED + mcLocale.getString("m.mccClearMySpawn"));
|
||||
}
|
||||
|
||||
if (mcPermissions.getInstance().mcAbility(player))
|
||||
player.sendMessage(LoadProperties.mcability + ChatColor.RED + " " + mcLocale.getString("m.mccToggleAbility"));
|
||||
player.sendMessage("/mcability" + ChatColor.RED + " " + mcLocale.getString("m.mccToggleAbility"));
|
||||
|
||||
if (mcPermissions.getInstance().adminChat(player))
|
||||
player.sendMessage("/a " + ChatColor.RED + mcLocale.getString("m.mccAdminToggle"));
|
||||
|
||||
if (mcPermissions.getInstance().whois(player))
|
||||
player.sendMessage(LoadProperties.whois + " " + mcLocale.getString("m.mccWhois"));
|
||||
player.sendMessage("/whois " + mcLocale.getString("m.mccWhois"));
|
||||
|
||||
if (mcPermissions.getInstance().mmoedit(player))
|
||||
player.sendMessage(LoadProperties.mmoedit + mcLocale.getString("m.mccMmoedit"));
|
||||
player.sendMessage("/mmoedit" + mcLocale.getString("m.mccMmoedit"));
|
||||
|
||||
if (mcPermissions.getInstance().mcgod(player))
|
||||
player.sendMessage(LoadProperties.mcgod + ChatColor.RED + " " + mcLocale.getString("m.mccMcGod"));
|
||||
player.sendMessage("/mcgod" + ChatColor.RED + " " + mcLocale.getString("m.mccMcGod"));
|
||||
|
||||
player.sendMessage(mcLocale.getString("m.mccSkillInfo"));
|
||||
player.sendMessage(LoadProperties.mcmmo + " " + mcLocale.getString("m.mccModDescription"));
|
||||
player.sendMessage("/mcmmo " + mcLocale.getString("m.mccModDescription"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class McmmoCommand implements CommandExecutor {
|
||||
Player player = (Player) sender;
|
||||
|
||||
player.sendMessage(ChatColor.RED + "-----[]" + ChatColor.GREEN + "mcMMO" + ChatColor.RED + "[]-----");
|
||||
String description = mcLocale.getString("mcMMO.Description", new Object[] { LoadProperties.mcc });
|
||||
String description = mcLocale.getString("mcMMO.Description", new Object[] { "/mcc" });
|
||||
String[] mcSplit = description.split(",");
|
||||
|
||||
for (String x : mcSplit) {
|
||||
|
@ -48,7 +48,7 @@ public class InviteCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length < 1) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /" + LoadProperties.invite + " <playername>");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /invite <playername>");
|
||||
return true;
|
||||
}
|
||||
if (PP.inParty() && args.length >= 1 && (plugin.getServer().getPlayer(args[0]) != null)) {
|
||||
@ -61,7 +61,7 @@ public class InviteCommand implements CommandExecutor {
|
||||
// target.sendMessage(ChatColor.RED+"ALERT: "+ChatColor.GREEN+"You have received a party invite for "+PPt.getInvite()+" from "+player.getName());
|
||||
target.sendMessage(mcLocale.getString("mcPlayerListener.ReceivedInvite1", new Object[] { PPt.getInvite(), player.getName() }));
|
||||
// target.sendMessage(ChatColor.YELLOW+"Type "+ChatColor.GREEN+LoadProperties.accept+ChatColor.YELLOW+" to accept the invite");
|
||||
target.sendMessage(mcLocale.getString("mcPlayerListener.ReceivedInvite2", new Object[] { LoadProperties.accept }));
|
||||
target.sendMessage(mcLocale.getString("mcPlayerListener.ReceivedInvite2", new Object[] { "/accept" }));
|
||||
} else {
|
||||
player.sendMessage(mcLocale.getString("Party.Locked"));
|
||||
return true;
|
||||
|
@ -42,9 +42,9 @@ public class PartyCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (args.length == 0 && !PP.inParty()) {
|
||||
player.sendMessage(mcLocale.getString("Party.Help1", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help3", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help1", new Object[] { "/party "}));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { "/party "}));
|
||||
player.sendMessage(mcLocale.getString("Party.Help3", new Object[] { "/party " }));
|
||||
return true;
|
||||
} else if (args.length == 0 && PP.inParty()) {
|
||||
String tempList = "";
|
||||
@ -81,13 +81,13 @@ public class PartyCommand implements CommandExecutor {
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.LeftParty"));
|
||||
return true;
|
||||
} else if (args[0].equalsIgnoreCase("?")) {
|
||||
player.sendMessage(mcLocale.getString("Party.Help4", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help5", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help6", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help7", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help8", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help9", new Object[] { LoadProperties.party }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help4", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help5", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help6", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help7", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help8", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help9", new Object[] { "/party " }));
|
||||
} else if (args[0].equalsIgnoreCase("lock")) {
|
||||
if (PP.inParty()) {
|
||||
if (Pinstance.isPartyLeader(player.getName(), PP.getParty())) {
|
||||
|
@ -40,7 +40,7 @@ public class PtpCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length < 1) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /" + LoadProperties.ptp + " <playername>");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /ptp <playername>");
|
||||
return true;
|
||||
}
|
||||
if (plugin.getServer().getPlayer(args[0]) == null) {
|
||||
|
@ -44,10 +44,8 @@ public class LoadProperties {
|
||||
diamondTools, enderPearl, blazeRod, records, glowstoneDust,
|
||||
fishingDiamonds;
|
||||
|
||||
public static String xplock, MySQLtablePrefix, MySQLuserName,
|
||||
MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, xprate,
|
||||
mcability, mcmmo, mcc, mcrefresh, mcgod, stats, mmoedit, ptp,
|
||||
party, myspawn, whois, invite, accept, clearmyspawn, nWood, nStone,
|
||||
public static String MySQLtablePrefix, MySQLuserName,
|
||||
MySQLserverName, MySQLdbName, MySQLdbPass, nWood, nStone,
|
||||
nIron, nGold, nDiamond, locale, nString, nLeather;
|
||||
|
||||
public static int mfishing, mwatch, xpbar_x, xpbar_y, xpicon_x, xpicon_y,
|
||||
@ -405,6 +403,5 @@ public class LoadProperties {
|
||||
inviteEnable = readBoolean("Commands.invite.Enabled", true);
|
||||
acceptEnable = readBoolean("Commands.accept.Enabled", true);
|
||||
clearmyspawnEnable = readBoolean("Commands.clearmyspawn.Enabled", true);
|
||||
xplock = readString("Commands.xplock.Name", "xplock");
|
||||
}
|
||||
}
|
@ -164,7 +164,7 @@ public class mcPlayerListener implements Listener
|
||||
Player player = event.getPlayer();
|
||||
if(mcPermissions.getInstance().motd(player) && LoadProperties.enableMotd)
|
||||
{
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), LoadProperties.mcmmo}));
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), "/mcmmo"}));
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.WIKI"));
|
||||
}
|
||||
//THIS IS VERY BAD WAY TO DO THINGS, NEED BETTER WAY
|
||||
|
@ -275,36 +275,6 @@ public class mcMMO extends JavaPlugin
|
||||
aliasMap.put(mcLocale.getString("m.SkillUnarmed").toLowerCase(), "unarmed");
|
||||
aliasMap.put(mcLocale.getString("m.SkillWoodCutting").toLowerCase(), "woodcutting");
|
||||
|
||||
//Mc* commands
|
||||
aliasMap.put(LoadProperties.mcability, "mcability");
|
||||
aliasMap.put(LoadProperties.mcc, "mcc");
|
||||
aliasMap.put(LoadProperties.mcgod, "mcgod");
|
||||
aliasMap.put(LoadProperties.mcmmo, "mcmmo");
|
||||
aliasMap.put(LoadProperties.mcrefresh, "mcrefresh");
|
||||
aliasMap.put(LoadProperties.mctop, "mctop");
|
||||
|
||||
//Party commands
|
||||
aliasMap.put(LoadProperties.accept, "accept");
|
||||
//aliasMap.put(null, "a");
|
||||
aliasMap.put(LoadProperties.invite, "invite");
|
||||
aliasMap.put(LoadProperties.party, "party");
|
||||
//aliasMap.put(null, "p");
|
||||
aliasMap.put(LoadProperties.ptp, "ptp");
|
||||
|
||||
//Other commands
|
||||
aliasMap.put(LoadProperties.addxp, "addxp");
|
||||
aliasMap.put(LoadProperties.clearmyspawn, "clearmyspawn");
|
||||
aliasMap.put(LoadProperties.mmoedit, "mmoedit");
|
||||
//aliasMap.put(key, "mmoupdate");
|
||||
aliasMap.put(LoadProperties.myspawn, "myspawn");
|
||||
aliasMap.put(LoadProperties.stats, "stats");
|
||||
aliasMap.put(LoadProperties.whois, "whois");
|
||||
aliasMap.put(LoadProperties.xprate, "xprate");
|
||||
|
||||
//Spout commands
|
||||
//aliasMap.put(null, "mchud");
|
||||
aliasMap.put(LoadProperties.xplock, "xplock");
|
||||
|
||||
|
||||
//Register commands
|
||||
//Skills commands
|
||||
|
@ -246,7 +246,7 @@ public class Party
|
||||
if(password == null)
|
||||
{
|
||||
//TODO: Needs more locale.
|
||||
player.sendMessage("This party requires a password. Use "+LoadProperties.party+" <party> <password> to join it.");
|
||||
player.sendMessage("This party requires a password. Use /party <party> <password> to join it.");
|
||||
return;
|
||||
} else if(!password.equalsIgnoreCase(getPartyPassword(newParty)))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user