Permissions Murder 6: The quest for more money

This commit is contained in:
shatteredbeam 2013-02-15 09:47:24 -08:00
parent 4cf658b629
commit 2d0cf6413e
16 changed files with 25 additions and 41 deletions

View File

@ -8,7 +8,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyAcceptCommand implements CommandExecutor { public class PartyAcceptCommand implements CommandExecutor {
@ -17,7 +16,7 @@ public class PartyAcceptCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.accept")) { if (!sender.hasPermission("mcmmo.commands.party.accept")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -9,13 +9,12 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyChangeOwnerCommand implements CommandExecutor { public class PartyChangeOwnerCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.owner")) { if (!sender.hasPermission("mcmmo.commands.party.owner")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -7,14 +7,13 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyChangePasswordCommand implements CommandExecutor { public class PartyChangePasswordCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.password")) { if (!sender.hasPermission("mcmmo.commands.party.password")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.chat.commands.PartyChatCommand;
import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyCommand implements CommandExecutor { public class PartyCommand implements CommandExecutor {
@ -40,7 +39,7 @@ public class PartyCommand implements CommandExecutor {
return true; return true;
} }
if (!Permissions.hasPermission(sender, "mcmmo.commands.party")) { if (!sender.hasPermission("mcmmo.commands.party")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyCreateCommand implements CommandExecutor { public class PartyCreateCommand implements CommandExecutor {
@ -18,7 +17,7 @@ public class PartyCreateCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.create")) { if (!sender.hasPermission("mcmmo.commands.party.create")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -9,13 +9,12 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyDisbandCommand implements CommandExecutor { public class PartyDisbandCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.disband")) { if (!sender.hasPermission("mcmmo.commands.party.disband")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -10,8 +10,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.ShareHandler; import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.party.ShareHandler.ShareMode; import com.gmail.nossr50.party.ShareHandler.ShareMode;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyExpShareCommand implements CommandExecutor { public class PartyExpShareCommand implements CommandExecutor {
@ -24,7 +23,7 @@ public class PartyExpShareCommand implements CommandExecutor {
return true; return true;
} }
if (!Permissions.hasPermission(sender, "mcmmo.commands.party.expshare")) { if (!sender.hasPermission("mcmmo.commands.party.expshare")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }
@ -55,7 +54,7 @@ public class PartyExpShareCommand implements CommandExecutor {
playerParty.setXpShareMode(mode); playerParty.setXpShareMode(mode);
for (Player member : playerParty.getOnlineMembers()) { 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()))));
} }
} }
} }

View File

@ -4,13 +4,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;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.McMMOPlayer; import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyInviteCommand implements CommandExecutor { public class PartyInviteCommand implements CommandExecutor {
@ -23,7 +21,7 @@ public class PartyInviteCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.invite")) { if (!sender.hasPermission("mcmmo.commands.party.invite")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -10,8 +10,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.ShareHandler; import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.party.ShareHandler.ShareMode; import com.gmail.nossr50.party.ShareHandler.ShareMode;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyItemShareCommand implements CommandExecutor { public class PartyItemShareCommand implements CommandExecutor {
@ -24,7 +23,7 @@ public class PartyItemShareCommand implements CommandExecutor {
return true; return true;
} }
if (!Permissions.hasPermission(sender, "mcmmo.commands.party.itemshare")) { if (!sender.hasPermission("mcmmo.commands.party.itemshare")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }
@ -60,7 +59,7 @@ public class PartyItemShareCommand implements CommandExecutor {
playerParty.setItemShareMode(mode); playerParty.setItemShareMode(mode);
for (Player member : playerParty.getOnlineMembers()) { 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()))));
} }
} }
} }

View File

@ -10,7 +10,6 @@ import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyJoinCommand implements CommandExecutor { public class PartyJoinCommand implements CommandExecutor {
@ -24,7 +23,7 @@ public class PartyJoinCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.join")) { if (!sender.hasPermission("mcmmo.commands.party.join")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -11,13 +11,12 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyKickCommand implements CommandExecutor { public class PartyKickCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.kick")) { if (!sender.hasPermission("mcmmo.commands.party.kick")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -7,7 +7,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyLockCommand implements CommandExecutor { public class PartyLockCommand implements CommandExecutor {
@ -56,7 +55,7 @@ public class PartyLockCommand implements CommandExecutor {
* Handle locking a party. * Handle locking a party.
*/ */
private void lockParty(CommandSender sender, Command command) { 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()); sender.sendMessage(command.getPermissionMessage());
return; return;
} }
@ -76,7 +75,7 @@ public class PartyLockCommand implements CommandExecutor {
* @return true if party is successfully unlocked, false otherwise. * @return true if party is successfully unlocked, false otherwise.
*/ */
private void unlockParty(CommandSender sender, Command command) { 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()); sender.sendMessage(command.getPermissionMessage());
return; return;
} }

View File

@ -9,7 +9,6 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyQuitCommand implements CommandExecutor { public class PartyQuitCommand implements CommandExecutor {
@ -18,7 +17,7 @@ public class PartyQuitCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.quit")) { if (!sender.hasPermission("mcmmo.commands.party.quit")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -9,14 +9,13 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyRenameCommand implements CommandExecutor { public class PartyRenameCommand 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 (!Permissions.hasPermission(sender, "mcmmo.commands.party.rename")) { if (!sender.hasPermission("mcmmo.commands.party.rename")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -38,7 +38,7 @@ public class PtpCommand implements CommandExecutor {
playerProfile = mcMMOPlayer.getProfile(); playerProfile = mcMMOPlayer.getProfile();
if (args[0].equalsIgnoreCase("toggle")) { if (args[0].equalsIgnoreCase("toggle")) {
if (!Permissions.hasPermission(sender, "mcmmo.commands.ptp.toggle")) { if (!sender.hasPermission("mcmmo.commands.ptp.toggle")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }
@ -47,7 +47,7 @@ public class PtpCommand implements CommandExecutor {
} }
if (args[0].equalsIgnoreCase("acceptany") || args[0].equalsIgnoreCase("acceptall")) { 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()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }
@ -63,7 +63,7 @@ public class PtpCommand implements CommandExecutor {
} }
if (args[0].equalsIgnoreCase("accept")) { if (args[0].equalsIgnoreCase("accept")) {
if (!Permissions.hasPermission(sender, "mcmmo.commands.ptp.accept")) { if (!sender.hasPermission("mcmmo.commands.ptp.accept")) {
sender.sendMessage(command.getPermissionMessage()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }

View File

@ -6,8 +6,7 @@ import org.bukkit.command.CommandSender;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillTools; import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
public class XplockCommand extends SpoutCommand { public class XplockCommand extends SpoutCommand {
@Override @Override
@ -38,7 +37,7 @@ public class XplockCommand extends SpoutCommand {
return true; 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()); sender.sendMessage(command.getPermissionMessage());
return true; return true;
} }
@ -52,7 +51,7 @@ public class XplockCommand extends SpoutCommand {
spoutHud.setXpBarLocked(true); spoutHud.setXpBarLocked(true);
spoutHud.setSkillLock(skill); spoutHud.setSkillLock(skill);
spoutHud.updateXpBar(); spoutHud.updateXpBar();
sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", StringUtils.getCapitalized(skill.toString()))); sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", Misc.getCapitalized(skill.toString())));
} }
} }