mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Check for permissions instead of isOp() (#6)
This commit is contained in:
parent
2856889bbe
commit
a5200fd5c1
@ -74,7 +74,7 @@ public class PlaceholderAPICommands implements CommandExecutor {
|
|||||||
"&b/papi reload",
|
"&b/papi reload",
|
||||||
"&fReload the config settings");
|
"&fReload the config settings");
|
||||||
|
|
||||||
if (s.isOp()) {
|
if (s.hasPermission("placeholderapi.ecloud")) {
|
||||||
if (plugin.getExpansionCloud() == null) {
|
if (plugin.getExpansionCloud() == null) {
|
||||||
Msg.msg(s, "&b/papi enablecloud",
|
Msg.msg(s, "&b/papi enablecloud",
|
||||||
"&fEnable the expansion cloud");
|
"&fEnable the expansion cloud");
|
||||||
@ -97,7 +97,7 @@ public class PlaceholderAPICommands implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else if (args[0].equalsIgnoreCase("ecloud")) {
|
} else if (args[0].equalsIgnoreCase("ecloud")) {
|
||||||
if (!s.isOp()) {
|
if (!s.hasPermission("placeholderapi.ecloud")) {
|
||||||
Msg.msg(s, "&cYou don't have permission to do that!");
|
Msg.msg(s, "&cYou don't have permission to do that!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ public class PlaceholderAPICommands implements CommandExecutor {
|
|||||||
return eCloud.onCommand(s, c, label, args);
|
return eCloud.onCommand(s, c, label, args);
|
||||||
|
|
||||||
} else if (args[0].equalsIgnoreCase("enablecloud")) {
|
} else if (args[0].equalsIgnoreCase("enablecloud")) {
|
||||||
if (!s.isOp()) {
|
if (!s.hasPermission("placeholderapi.ecloud")) {
|
||||||
Msg.msg(s, "&cYou don't have permission to do that!");
|
Msg.msg(s, "&cYou don't have permission to do that!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ public class PlaceholderAPICommands implements CommandExecutor {
|
|||||||
|
|
||||||
} else if (args[0].equalsIgnoreCase("disablecloud")) {
|
} else if (args[0].equalsIgnoreCase("disablecloud")) {
|
||||||
|
|
||||||
if (!s.isOp()) {
|
if (!s.hasPermission("placeholderapi.ecloud")) {
|
||||||
Msg.msg(s, "&cYou don't have permission to do that!");
|
Msg.msg(s, "&cYou don't have permission to do that!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class UpdateChecker implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onJoin(PlayerJoinEvent e) {
|
public void onJoin(PlayerJoinEvent e) {
|
||||||
if (e.getPlayer().isOp()) {
|
if (e.getPlayer().hasPermission("placeholderapi.updatenotify")) {
|
||||||
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&bAn update for &fPlaceholder&7API &e(&fPlaceholder&7API &fv" + getLatestVersion() + "&e)"));
|
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&bAn update for &fPlaceholder&7API &e(&fPlaceholder&7API &fv" + getLatestVersion() + "&e)"));
|
||||||
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&bis available at &ehttps://www.spigotmc.org/resources/placeholderapi." + resourceId + "/"));
|
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&bis available at &ehttps://www.spigotmc.org/resources/placeholderapi." + resourceId + "/"));
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,7 @@ import java.util.Arrays;
|
|||||||
public class Msg {
|
public class Msg {
|
||||||
|
|
||||||
public static void msg(CommandSender s, String... msg) {
|
public static void msg(CommandSender s, String... msg) {
|
||||||
Arrays.stream(msg).forEach(text ->
|
Arrays.stream(msg).forEach(text -> s.sendMessage(ChatColor.translateAlternateColorCodes('&', text)));
|
||||||
s.sendMessage(ChatColor.translateAlternateColorCodes('&', text)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,12 @@ permissions:
|
|||||||
children:
|
children:
|
||||||
placeholderapi.list: true
|
placeholderapi.list: true
|
||||||
placeholderapi.reload: true
|
placeholderapi.reload: true
|
||||||
|
placeholderapi.ecloud: true
|
||||||
placeholderapi.parse: true
|
placeholderapi.parse: true
|
||||||
placeholderapi.injector.chat.bypass: true
|
placeholderapi.injector.chat.bypass: true
|
||||||
placeholderapi.injector.signs.bypass: true
|
placeholderapi.injector.signs.bypass: true
|
||||||
placeholderapi.injector.anvil.bypass: true
|
placeholderapi.injector.anvil.bypass: true
|
||||||
|
placeholderapi.updatenotify: true
|
||||||
placeholderapi.list:
|
placeholderapi.list:
|
||||||
description: ability to use the list command
|
description: ability to use the list command
|
||||||
default: op
|
default: op
|
||||||
@ -26,6 +28,12 @@ permissions:
|
|||||||
placeholderapi.parse:
|
placeholderapi.parse:
|
||||||
description: ability to use parse command
|
description: ability to use parse command
|
||||||
default: op
|
default: op
|
||||||
|
placeholderapi.ecloud:
|
||||||
|
description: allows the usage of ecloud commands
|
||||||
|
default: op
|
||||||
|
placeholderapi.updatenotify:
|
||||||
|
description: notifies you when there is a PAPI update
|
||||||
|
default: op
|
||||||
commands:
|
commands:
|
||||||
placeholderapi:
|
placeholderapi:
|
||||||
description: PlaceholderAPI command
|
description: PlaceholderAPI command
|
||||||
|
Loading…
Reference in New Issue
Block a user