Fixed "coreprotect.inspect" permission not being checked at the time of inspection (fixes #133)

This commit is contained in:
Intelli 2022-02-10 20:36:38 -07:00
parent fdb98bd329
commit b1c2795289
3 changed files with 18 additions and 2 deletions

View File

@ -33,6 +33,11 @@ public final class HangingBreakByEntityListener extends Queue implements Listene
class BasicThread implements Runnable {
@Override
public void run() {
if (!player.hasPermission("coreprotect.inspect")) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
ConfigHandler.inspecting.put(player.getName(), false);
return;
}
if (ConfigHandler.converterRunning) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.UPGRADE_IN_PROGRESS));
return;

View File

@ -53,6 +53,11 @@ public final class ArmorStandManipulateListener extends Queue implements Listene
class BasicThread implements Runnable {
@Override
public void run() {
if (!finalPlayer.hasPermission("coreprotect.inspect")) {
Chat.sendMessage(finalPlayer, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
ConfigHandler.inspecting.put(finalPlayer.getName(), false);
return;
}
if (ConfigHandler.converterRunning) {
Chat.sendMessage(finalPlayer, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.UPGRADE_IN_PROGRESS));
return;

View File

@ -69,6 +69,12 @@ public final class PlayerInteractListener extends Queue implements Listener {
return;
}
if (!player.hasPermission("coreprotect.inspect")) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
ConfigHandler.inspecting.put(player.getName(), false);
return;
}
if (event.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
BlockState checkBlock = event.getClickedBlock().getState();
int x = checkBlock.getX();
@ -278,8 +284,8 @@ public final class PlayerInteractListener extends Queue implements Listener {
if (ConfigHandler.lookupThrottle.get(player.getName()) != null) {
Object[] lookupThrottle = ConfigHandler.lookupThrottle.get(player.getName());
if ((boolean) lookupThrottle[0] || (System.currentTimeMillis() - (long) lookupThrottle[1]) < 100) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.DATABASE_BUSY));
return;
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.DATABASE_BUSY));
return;
}
}