Made listeners monitor level to override essentials
This commit is contained in:
parent
381682c188
commit
1cccf6450f
@ -21,7 +21,7 @@ import com.redstoner.misc.Utils;
|
|||||||
import com.redstoner.modules.Module;
|
import com.redstoner.modules.Module;
|
||||||
|
|
||||||
@AutoRegisterListener
|
@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
|
public class Vanish implements Module, Listener
|
||||||
{
|
{
|
||||||
private ArrayList<UUID> vanished = new ArrayList<UUID>();
|
private ArrayList<UUID> vanished = new ArrayList<UUID>();
|
||||||
@ -127,14 +127,17 @@ public class Vanish implements Module, Listener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPlayerJoin(PlayerJoinEvent event)
|
public void onPlayerJoin(PlayerJoinEvent event)
|
||||||
{
|
{
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (vanished.contains(player.getUniqueId()))
|
if (vanished.contains(player.getUniqueId()))
|
||||||
{
|
{
|
||||||
for (Player p : Bukkit.getOnlinePlayers())
|
for (Player p : Bukkit.getOnlinePlayers())
|
||||||
p.hidePlayer(player);
|
{
|
||||||
|
if (!p.hasPermission("utils.vanish"))
|
||||||
|
p.hidePlayer(player);
|
||||||
|
}
|
||||||
event.setJoinMessage(null);
|
event.setJoinMessage(null);
|
||||||
}
|
}
|
||||||
if (player.hasPermission("utils.vanish"))
|
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)
|
public void onPlayerLeave(PlayerQuitEvent event)
|
||||||
{
|
{
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
Reference in New Issue
Block a user