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:
parent
e3ed803856
commit
d6794c5820
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user