1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Added permission check to open_guide

Now the command "/sf open_guide" will be executed only if the player has the "slimefun.command.open_guide" permission. (Default: op)
This commit is contained in:
Redemption 2017-11-18 18:05:50 +01:00 committed by GitHub
parent e3ed803856
commit d6794c5820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,11 @@ public class SlimefunCommand implements CommandExecutor, Listener {
else Messages.local.sendTranslation(sender, "messages.only-players", true); else Messages.local.sendTranslation(sender, "messages.only-players", true);
} }
else if(args[0].equalsIgnoreCase("open_guide")) { else if(args[0].equalsIgnoreCase("open_guide")) {
if (sender instanceof Player) SlimefunGuide.openGuide((Player) sender, SlimefunStartup.getCfg().getBoolean("guide.default-view-book")); if (sender instanceof Player) {
if(sender.hasPermission("slimefun.command.open_guide")) SlimefunGuide.openGuide((Player) sender, SlimefunStartup.getCfg().getBoolean("guide.default-view-book"));
else Messages.local.sendTranslation(sender, "messages.no-permission", true);
}
else Messages.local.sendTranslation(sender, "messages.only-players", true);
} }
else if (args[0].equalsIgnoreCase("guide")) { else if (args[0].equalsIgnoreCase("guide")) {
if (sender instanceof Player) { if (sender instanceof Player) {