diff --git a/src/main/java/it/frafol/cleanping/bukkit/commands/PingCommand.java b/src/main/java/it/frafol/cleanping/bukkit/commands/PingCommand.java index 421c443..19c8f2f 100644 --- a/src/main/java/it/frafol/cleanping/bukkit/commands/PingCommand.java +++ b/src/main/java/it/frafol/cleanping/bukkit/commands/PingCommand.java @@ -55,7 +55,7 @@ public boolean onCommand(org.bukkit.command.@NotNull CommandSender source, @NotN } else if (args.length == 1) { - if (!source.hasPermission(Placeholder.translate(SpigotConfig.PING_OTHERS_PERMISSION.get(String.class)))) { + if (!source.isOp() && !source.hasPermission(Placeholder.translate(SpigotConfig.PING_OTHERS_PERMISSION.get(String.class)))) { source.sendMessage(Placeholder.translate(SpigotMessages.NO_PERMISSION.get(String.class)) .replace("%prefix%", Placeholder.translate(SpigotMessages.PREFIX.get(String.class)))); return false; @@ -91,7 +91,7 @@ public boolean onCommand(org.bukkit.command.@NotNull CommandSender source, @NotN } else if (args.length == 2) { - if (!source.hasPermission(Placeholder.translate(SpigotConfig.DIFFERENCE_PING_PERMISSION.get(String.class)))) { + if (!source.isOp() && !source.hasPermission(Placeholder.translate(SpigotConfig.DIFFERENCE_PING_PERMISSION.get(String.class)))) { source.sendMessage(Placeholder.translate(SpigotMessages.NO_PERMISSION.get(String.class)) .replace("%prefix%", Placeholder.translate(SpigotMessages.PREFIX.get(String.class)))); return false; diff --git a/src/main/java/it/frafol/cleanping/bukkit/commands/legacy/PingCommand.java b/src/main/java/it/frafol/cleanping/bukkit/commands/legacy/PingCommand.java index 45b1488..c553f8e 100644 --- a/src/main/java/it/frafol/cleanping/bukkit/commands/legacy/PingCommand.java +++ b/src/main/java/it/frafol/cleanping/bukkit/commands/legacy/PingCommand.java @@ -52,7 +52,7 @@ public boolean onCommand(@NotNull CommandSender source, @NotNull Command command } else if (args.length == 1) { - if (!source.hasPermission(SpigotConfig.PING_OTHERS_PERMISSION.get(String.class))) { + if (!source.isOp() && !source.hasPermission(SpigotConfig.PING_OTHERS_PERMISSION.get(String.class))) { source.sendMessage(SpigotMessages.NO_PERMISSION.color() .replace("%prefix%", SpigotMessages.PREFIX.color())); return false; @@ -88,7 +88,7 @@ public boolean onCommand(@NotNull CommandSender source, @NotNull Command command } else if (args.length == 2) { - if (!source.hasPermission(SpigotConfig.DIFFERENCE_PING_PERMISSION.get(String.class))) { + if (!source.isOp() && !source.hasPermission(SpigotConfig.DIFFERENCE_PING_PERMISSION.get(String.class))) { source.sendMessage(SpigotMessages.NO_PERMISSION.color() .replace("%prefix%", Placeholder.translate(SpigotMessages.PREFIX.get(String.class)))); return false;