forked from LogBlock/LogBlock
Fixed everyone with logblock.spawnTools was allowed to spawn tools
without the tool permission
This commit is contained in:
@@ -135,10 +135,11 @@ public class CommandsHandler implements CommandExecutor
|
||||
sender.sendMessage(ChatColor.GOLD + msg.substring(2));
|
||||
}
|
||||
} 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) {
|
||||
final Player player = (Player)sender;
|
||||
final Session session = Session.getSession(player.getName());
|
||||
final Tool tool = config.toolsByName.get(command);
|
||||
final ToolData toolData = session.toolData.get(tool);
|
||||
if (args.length == 1) {
|
||||
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.");
|
||||
} else
|
||||
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")) {
|
||||
if (sender instanceof Player) {
|
||||
if (logblock.hasPermission(sender, "logblock.hide")) {
|
||||
|
Reference in New Issue
Block a user