From 1cccf6450f2b0354feb19d9e9d6a05adb4872548 Mon Sep 17 00:00:00 2001 From: Pepich Date: Thu, 2 Mar 2017 21:16:06 +0100 Subject: [PATCH] Made listeners monitor level to override essentials --- src/com/redstoner/modules/vanish/Vanish.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/redstoner/modules/vanish/Vanish.java b/src/com/redstoner/modules/vanish/Vanish.java index d01ee19..52513db 100644 --- a/src/com/redstoner/modules/vanish/Vanish.java +++ b/src/com/redstoner/modules/vanish/Vanish.java @@ -21,7 +21,7 @@ import com.redstoner.misc.Utils; import com.redstoner.modules.Module; @AutoRegisterListener -@Version(major = 2, minor = 0, revision = 1, compatible = 2) +@Version(major = 2, minor = 0, revision = 2, compatible = 2) public class Vanish implements Module, Listener { private ArrayList vanished = new ArrayList(); @@ -127,14 +127,17 @@ public class Vanish implements Module, Listener return true; } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (vanished.contains(player.getUniqueId())) { for (Player p : Bukkit.getOnlinePlayers()) - p.hidePlayer(player); + { + if (!p.hasPermission("utils.vanish")) + p.hidePlayer(player); + } event.setJoinMessage(null); } if (player.hasPermission("utils.vanish")) @@ -158,7 +161,7 @@ public class Vanish implements Module, Listener } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.MONITOR) public void onPlayerLeave(PlayerQuitEvent event) { Player player = event.getPlayer();