From 2d0cf6413e352f115cd261aa6449ee37d926525e Mon Sep 17 00:00:00 2001 From: shatteredbeam Date: Fri, 15 Feb 2013 09:47:24 -0800 Subject: [PATCH] Permissions Murder 6: The quest for more money --- .../gmail/nossr50/party/commands/PartyAcceptCommand.java | 3 +-- .../nossr50/party/commands/PartyChangeOwnerCommand.java | 3 +-- .../nossr50/party/commands/PartyChangePasswordCommand.java | 3 +-- .../com/gmail/nossr50/party/commands/PartyCommand.java | 3 +-- .../gmail/nossr50/party/commands/PartyCreateCommand.java | 3 +-- .../gmail/nossr50/party/commands/PartyDisbandCommand.java | 3 +-- .../gmail/nossr50/party/commands/PartyExpShareCommand.java | 7 +++---- .../gmail/nossr50/party/commands/PartyInviteCommand.java | 4 +--- .../nossr50/party/commands/PartyItemShareCommand.java | 7 +++---- .../com/gmail/nossr50/party/commands/PartyJoinCommand.java | 3 +-- .../com/gmail/nossr50/party/commands/PartyKickCommand.java | 3 +-- .../com/gmail/nossr50/party/commands/PartyLockCommand.java | 5 ++--- .../com/gmail/nossr50/party/commands/PartyQuitCommand.java | 3 +-- .../gmail/nossr50/party/commands/PartyRenameCommand.java | 3 +-- .../java/com/gmail/nossr50/party/commands/PtpCommand.java | 6 +++--- .../com/gmail/nossr50/spout/commands/XplockCommand.java | 7 +++---- 16 files changed, 25 insertions(+), 41 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyAcceptCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyAcceptCommand.java index ef65d9231..2b51703a8 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyAcceptCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyAcceptCommand.java @@ -8,7 +8,6 @@ import org.bukkit.entity.Player; import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyAcceptCommand implements CommandExecutor { @@ -17,7 +16,7 @@ public class PartyAcceptCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.accept")) { + if (!sender.hasPermission("mcmmo.commands.party.accept")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyChangeOwnerCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyChangeOwnerCommand.java index bcbbd4fa5..85d871a9c 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyChangeOwnerCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyChangeOwnerCommand.java @@ -9,13 +9,12 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyChangeOwnerCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.owner")) { + if (!sender.hasPermission("mcmmo.commands.party.owner")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyChangePasswordCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyChangePasswordCommand.java index 7f42dfcf8..edf74dbc5 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyChangePasswordCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyChangePasswordCommand.java @@ -7,14 +7,13 @@ import org.bukkit.entity.Player; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyChangePasswordCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.password")) { + if (!sender.hasPermission("mcmmo.commands.party.password")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java index 3f62f36b6..6b71690e6 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.chat.commands.PartyChatCommand; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyCommand implements CommandExecutor { @@ -40,7 +39,7 @@ public class PartyCommand implements CommandExecutor { return true; } - if (!Permissions.hasPermission(sender, "mcmmo.commands.party")) { + if (!sender.hasPermission("mcmmo.commands.party")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyCreateCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyCreateCommand.java index d71bf8ef8..972838d7f 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyCreateCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyCreateCommand.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyCreateCommand implements CommandExecutor { @@ -18,7 +17,7 @@ public class PartyCreateCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.create")) { + if (!sender.hasPermission("mcmmo.commands.party.create")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java index 7dc3f34f5..61b96da12 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java @@ -9,13 +9,12 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyDisbandCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.disband")) { + if (!sender.hasPermission("mcmmo.commands.party.disband")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyExpShareCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyExpShareCommand.java index 94fa4a1c6..8ac37e502 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyExpShareCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyExpShareCommand.java @@ -10,8 +10,7 @@ import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.ShareHandler; import com.gmail.nossr50.party.ShareHandler.ShareMode; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Users; public class PartyExpShareCommand implements CommandExecutor { @@ -24,7 +23,7 @@ public class PartyExpShareCommand implements CommandExecutor { return true; } - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.expshare")) { + if (!sender.hasPermission("mcmmo.commands.party.expshare")) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -55,7 +54,7 @@ public class PartyExpShareCommand implements CommandExecutor { playerParty.setXpShareMode(mode); for (Player member : playerParty.getOnlineMembers()) { - member.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Exp"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())))); + member.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Exp"), LocaleLoader.getString("Party.ShareMode." + Misc.getCapitalized(mode.toString())))); } } } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyInviteCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyInviteCommand.java index bb36b99ea..cdc5a7bbc 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyInviteCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyInviteCommand.java @@ -4,13 +4,11 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; - import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyInviteCommand implements CommandExecutor { @@ -23,7 +21,7 @@ public class PartyInviteCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.invite")) { + if (!sender.hasPermission("mcmmo.commands.party.invite")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyItemShareCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyItemShareCommand.java index 6ea13d301..6757e0e7d 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyItemShareCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyItemShareCommand.java @@ -10,8 +10,7 @@ import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.ShareHandler; import com.gmail.nossr50.party.ShareHandler.ShareMode; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Users; public class PartyItemShareCommand implements CommandExecutor { @@ -24,7 +23,7 @@ public class PartyItemShareCommand implements CommandExecutor { return true; } - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.itemshare")) { + if (!sender.hasPermission("mcmmo.commands.party.itemshare")) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -60,7 +59,7 @@ public class PartyItemShareCommand implements CommandExecutor { playerParty.setItemShareMode(mode); for (Player member : playerParty.getOnlineMembers()) { - member.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Item"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())))); + member.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Item"), LocaleLoader.getString("Party.ShareMode." + Misc.getCapitalized(mode.toString())))); } } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyJoinCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyJoinCommand.java index 64dbb0f2a..9cf8ab39e 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyJoinCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyJoinCommand.java @@ -10,7 +10,6 @@ import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyJoinCommand implements CommandExecutor { @@ -24,7 +23,7 @@ public class PartyJoinCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.join")) { + if (!sender.hasPermission("mcmmo.commands.party.join")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyKickCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyKickCommand.java index faf1f60ac..7fe44ce1f 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyKickCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyKickCommand.java @@ -11,13 +11,12 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyKickCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.kick")) { + if (!sender.hasPermission("mcmmo.commands.party.kick")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyLockCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyLockCommand.java index d20fba6a8..3153376f8 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyLockCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyLockCommand.java @@ -7,7 +7,6 @@ import org.bukkit.entity.Player; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyLockCommand implements CommandExecutor { @@ -56,7 +55,7 @@ public class PartyLockCommand implements CommandExecutor { * Handle locking a party. */ private void lockParty(CommandSender sender, Command command) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.lock")) { + if (!sender.hasPermission("mcmmo.commands.party.lock")) { sender.sendMessage(command.getPermissionMessage()); return; } @@ -76,7 +75,7 @@ public class PartyLockCommand implements CommandExecutor { * @return true if party is successfully unlocked, false otherwise. */ private void unlockParty(CommandSender sender, Command command) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.unlock")) { + if (!sender.hasPermission("mcmmo.commands.party.unlock")) { sender.sendMessage(command.getPermissionMessage()); return; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyQuitCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyQuitCommand.java index 78efb537b..6bf28cefb 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyQuitCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyQuitCommand.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyQuitCommand implements CommandExecutor { @@ -18,7 +17,7 @@ public class PartyQuitCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.quit")) { + if (!sender.hasPermission("mcmmo.commands.party.quit")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyRenameCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyRenameCommand.java index 9ae2dea45..1eb12d4db 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyRenameCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyRenameCommand.java @@ -9,14 +9,13 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class PartyRenameCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.party.rename")) { + if (!sender.hasPermission("mcmmo.commands.party.rename")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/party/commands/PtpCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PtpCommand.java index f07e5ed07..c0f01180c 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PtpCommand.java @@ -38,7 +38,7 @@ public class PtpCommand implements CommandExecutor { playerProfile = mcMMOPlayer.getProfile(); if (args[0].equalsIgnoreCase("toggle")) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.ptp.toggle")) { + if (!sender.hasPermission("mcmmo.commands.ptp.toggle")) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -47,7 +47,7 @@ public class PtpCommand implements CommandExecutor { } if (args[0].equalsIgnoreCase("acceptany") || args[0].equalsIgnoreCase("acceptall")) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.ptp.acceptall")) { + if (!sender.hasPermission("mcmmo.commands.ptp.acceptall")) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -63,7 +63,7 @@ public class PtpCommand implements CommandExecutor { } if (args[0].equalsIgnoreCase("accept")) { - if (!Permissions.hasPermission(sender, "mcmmo.commands.ptp.accept")) { + if (!sender.hasPermission("mcmmo.commands.ptp.accept")) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java b/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java index 48afb045a..d6bbf9d10 100644 --- a/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java +++ b/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java @@ -6,8 +6,7 @@ import org.bukkit.command.CommandSender; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.utilities.SkillTools; import com.gmail.nossr50.skills.utilities.SkillType; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; +import com.gmail.nossr50.util.Misc; public class XplockCommand extends SpoutCommand { @Override @@ -38,7 +37,7 @@ public class XplockCommand extends SpoutCommand { return true; } - if (!Permissions.hasPermission(sender, "mcmmo.commands.xplock." + args[0].toLowerCase())) { + if (!sender.hasPermission("mcmmo.commands.xplock." + args[0].toLowerCase())) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -52,7 +51,7 @@ public class XplockCommand extends SpoutCommand { spoutHud.setXpBarLocked(true); spoutHud.setSkillLock(skill); spoutHud.updateXpBar(); - sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", StringUtils.getCapitalized(skill.toString()))); + sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", Misc.getCapitalized(skill.toString()))); } }