More command updates.

This commit is contained in:
GJ 2012-04-05 00:44:12 -04:00
parent 0c22064a94
commit a01a5a737b
6 changed files with 90 additions and 91 deletions

View File

@ -11,6 +11,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
public class McabilityCommand implements CommandExecutor { public class McabilityCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandHelper.noConsoleUsage(sender)) { if (CommandHelper.noConsoleUsage(sender)) {

View File

@ -7,57 +7,66 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
//TODO: Rework this whole thing. It's ugly.
public class MccCommand implements CommandExecutor { public class MccCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) { @Override
sender.sendMessage("This command does not support console useage."); public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
return true; if (CommandHelper.noConsoleUsage(sender)) {
} return true;
}
Player player = (Player) sender; Player player = (Player) sender;
player.sendMessage(ChatColor.RED + "---[]" + ChatColor.YELLOW + "mcMMO Commands" + ChatColor.RED + "[]---"); //TODO: Needs more locale. player.sendMessage(ChatColor.RED + "---[]" + ChatColor.YELLOW + "mcMMO Commands" + ChatColor.RED + "[]---"); //TODO: Needs more locale.
if (mcPermissions.getInstance().party(player)) { if (mcPermissions.getInstance().party(player)) {
player.sendMessage(mcLocale.getString("m.mccPartyCommands")); player.sendMessage(mcLocale.getString("m.mccPartyCommands"));
player.sendMessage("/party " + mcLocale.getString("m.mccParty")); player.sendMessage("/party " + mcLocale.getString("m.mccParty"));
player.sendMessage("/party q " + mcLocale.getString("m.mccPartyQ")); player.sendMessage("/party q " + mcLocale.getString("m.mccPartyQ"));
if (mcPermissions.getInstance().partyChat(player)) if (mcPermissions.getInstance().partyChat(player)) {
player.sendMessage("/p " + mcLocale.getString("m.mccPartyToggle")); player.sendMessage("/p " + mcLocale.getString("m.mccPartyToggle"));
}
player.sendMessage("/invite " + mcLocale.getString("m.mccPartyInvite")); player.sendMessage("/invite " + mcLocale.getString("m.mccPartyInvite"));
player.sendMessage("/invite " + mcLocale.getString("m.mccPartyAccept")); player.sendMessage("/invite " + mcLocale.getString("m.mccPartyAccept"));
if (mcPermissions.getInstance().partyTeleport(player)) if (mcPermissions.getInstance().partyTeleport(player)) {
player.sendMessage("/ptp " + mcLocale.getString("m.mccPartyTeleport")); player.sendMessage("/ptp " + mcLocale.getString("m.mccPartyTeleport"));
} }
player.sendMessage(mcLocale.getString("m.mccOtherCommands")); }
player.sendMessage("/mcstats " + ChatColor.RED + mcLocale.getString("m.mccStats"));
player.sendMessage("/mctop <skillname> <page> " + ChatColor.RED + mcLocale.getString("m.mccLeaderboards"));
if (mcPermissions.getInstance().mcAbility(player)) player.sendMessage(mcLocale.getString("m.mccOtherCommands"));
player.sendMessage("/mcability " + ChatColor.RED + mcLocale.getString("m.mccToggleAbility")); player.sendMessage("/mcstats " + ChatColor.RED + mcLocale.getString("m.mccStats"));
player.sendMessage("/mctop <skillname> <page> " + ChatColor.RED + mcLocale.getString("m.mccLeaderboards"));
if (mcPermissions.getInstance().adminChat(player)) if (mcPermissions.getInstance().mcAbility(player)) {
player.sendMessage("/a " + ChatColor.RED + mcLocale.getString("m.mccAdminToggle")); player.sendMessage("/mcability " + ChatColor.RED + mcLocale.getString("m.mccToggleAbility"));
}
if (mcPermissions.getInstance().inspect(player)) if (mcPermissions.getInstance().adminChat(player)) {
player.sendMessage("/inspect " + mcLocale.getString("m.mccInspect")); player.sendMessage("/a " + ChatColor.RED + mcLocale.getString("m.mccAdminToggle"));
}
if (mcPermissions.getInstance().mmoedit(player)) if (mcPermissions.getInstance().inspect(player)) {
player.sendMessage("/mmoedit " + mcLocale.getString("m.mccMmoedit")); player.sendMessage("/inspect " + mcLocale.getString("m.mccInspect"));
}
if (mcPermissions.getInstance().mcgod(player)) if (mcPermissions.getInstance().mmoedit(player)) {
player.sendMessage("/mcgod " + ChatColor.RED + mcLocale.getString("m.mccMcGod")); player.sendMessage("/mmoedit " + mcLocale.getString("m.mccMmoedit"));
}
player.sendMessage(mcLocale.getString("m.mccSkillInfo")); if (mcPermissions.getInstance().mcgod(player)) {
player.sendMessage("/mcmmo " + mcLocale.getString("m.mccModDescription")); player.sendMessage("/mcgod " + ChatColor.RED + mcLocale.getString("m.mccMcGod"));
}
return true; player.sendMessage(mcLocale.getString("m.mccSkillInfo"));
} player.sendMessage("/mcmmo " + mcLocale.getString("m.mccModDescription"));
return true;
}
} }

View File

@ -1,43 +1,38 @@
package com.gmail.nossr50.commands.mc; package com.gmail.nossr50.commands.mc;
import org.bukkit.ChatColor;
import org.bukkit.command.Command; 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;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
public class McgodCommand implements CommandExecutor { public class McgodCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) { @Override
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
return true; if (CommandHelper.noConsoleUsage(sender)) {
} return true;
}
Player player = (Player) sender; if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mcgod")) {
PlayerProfile PP = Users.getProfile(player); return true;
}
if (!mcPermissions.getInstance().mcgod(player)) { PlayerProfile PP = Users.getProfile((Player) sender);
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
if (mcPermissions.getInstance().mcgod(player)) { if (PP.getGodMode()) {
if (PP.getGodMode()) { sender.sendMessage(mcLocale.getString("mcPlayerListener.GodModeDisabled"));
player.sendMessage(mcLocale.getString("mcPlayerListener.GodModeDisabled")); }
PP.toggleGodMode(); else {
} else { sender.sendMessage(mcLocale.getString("mcPlayerListener.GodModeEnabled"));
player.sendMessage(mcLocale.getString("mcPlayerListener.GodModeEnabled")); }
PP.toggleGodMode();
}
}
return true; PP.toggleGodMode();
}
return true;
}
} }

View File

@ -1,10 +1,10 @@
package com.gmail.nossr50.commands.mc; package com.gmail.nossr50.commands.mc;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command; 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;
import org.bukkit.entity.Player;
import org.getspout.spoutapi.player.SpoutPlayer; import org.getspout.spoutapi.player.SpoutPlayer;
import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.config.LoadProperties;
@ -12,32 +12,26 @@ import com.gmail.nossr50.locale.mcLocale;
public class McmmoCommand implements CommandExecutor { public class McmmoCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
String description = mcLocale.getString("mcMMO.Description", new Object[] { "mcc" });
String[] mcSplit = description.split(",");
if (!(sender instanceof Player)) { for (String x : mcSplit) {
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale. sender.sendMessage(x);
return true; }
}
Player player = (Player) sender; if (LoadProperties.donateMessage) {
if (LoadProperties.spoutEnabled && sender instanceof SpoutPlayer) {
SpoutPlayer sPlayer = (SpoutPlayer) sender;
String description = mcLocale.getString("mcMMO.Description", new Object[] { "mcc" }); sPlayer.sendNotification(ChatColor.YELLOW + "[mcMMO]" + ChatColor.GOLD + " Donate!", ChatColor.GREEN + "nossr50@gmail.com", Material.DIAMOND);
String[] mcSplit = description.split(","); }
for (String x : mcSplit) { sender.sendMessage(ChatColor.DARK_AQUA + "Donation Info:");
player.sendMessage(x); sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "nossr50@gmail.com" + ChatColor.GOLD + " Paypal");
} }
if (LoadProperties.spoutEnabled && player instanceof SpoutPlayer) { return true;
SpoutPlayer sPlayer = (SpoutPlayer) player; }
if (LoadProperties.donateMessage)
sPlayer.sendMessage(ChatColor.YELLOW + "[mcMMO]"+ChatColor.GOLD+" Donate! Paypal "+ChatColor.GREEN+"nossr50@gmail.com"); //Where'd our notification go?
} else {
if (LoadProperties.donateMessage)
player.sendMessage(ChatColor.YELLOW + "[mcMMO]"+ChatColor.GOLD+" Donate! Paypal "+ChatColor.GREEN+"nossr50@gmail.com");
}
return true;
}
} }

View File

@ -302,7 +302,7 @@ m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELL
Combat.BeastLore=[[GREEN]]**BEAST LORE** Combat.BeastLore=[[GREEN]]**BEAST LORE**
Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]]) Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]])
Combat.BeastLoreHealth=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/{1}) Combat.BeastLoreHealth=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/{1})
mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Bukkit Forum Thread,[[DARK_AQUA]]Donation Info: mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Bukkit Forum Thread
Party.Locked=[[RED]]Party is locked, only party leader may invite. Party.Locked=[[RED]]Party is locked, only party leader may invite.
Party.IsntLocked=[[GRAY]]Party is not locked Party.IsntLocked=[[GRAY]]Party is not locked
Party.Unlocked=[[GRAY]]Party is unlocked Party.Unlocked=[[GRAY]]Party is unlocked