Fixed everyone with logblock.spawnTools was allowed to spawn tools

without the tool permission
This commit is contained in:
Robin Kupper
2011-11-12 11:01:09 +01:00
parent 0d9b4071df
commit 5998e37cd8

View File

@@ -135,10 +135,11 @@ public class CommandsHandler implements CommandExecutor
sender.sendMessage(ChatColor.GOLD + msg.substring(2)); sender.sendMessage(ChatColor.GOLD + msg.substring(2));
} }
} else if (config.toolsByName.get(command) != null) { } else if (config.toolsByName.get(command) != null) {
final Tool tool = config.toolsByName.get(command);
if (logblock.hasPermission(sender, "logblock.tools." + tool.name)) {
if (sender instanceof Player) { if (sender instanceof Player) {
final Player player = (Player)sender; final Player player = (Player)sender;
final Session session = Session.getSession(player.getName()); final Session session = Session.getSession(player.getName());
final Tool tool = config.toolsByName.get(command);
final ToolData toolData = session.toolData.get(tool); final ToolData toolData = session.toolData.get(tool);
if (args.length == 1) { if (args.length == 1) {
if (logblock.hasPermission(player, "logblock.spawnTools")) { if (logblock.hasPermission(player, "logblock.spawnTools")) {
@@ -186,6 +187,8 @@ public class CommandsHandler implements CommandExecutor
sender.sendMessage(ChatColor.RED + "You aren't allowed to do this."); sender.sendMessage(ChatColor.RED + "You aren't allowed to do this.");
} else } else
sender.sendMessage(ChatColor.RED + "You have to be a player."); sender.sendMessage(ChatColor.RED + "You have to be a player.");
} else
sender.sendMessage(ChatColor.RED + "You aren't allowed to do this.");
} else if (command.equals("hide")) { } else if (command.equals("hide")) {
if (sender instanceof Player) { if (sender instanceof Player) {
if (logblock.hasPermission(sender, "logblock.hide")) { if (logblock.hasPermission(sender, "logblock.hide")) {