Add ability to supress join/leave messages :: new permissions: essentials.silentjoin & essentials.silentquit

This commit is contained in:
Iaccidentally 2013-11-06 18:05:02 -05:00
parent 235f134514
commit d5196e31b2

View File

@ -164,6 +164,10 @@ public class EssentialsPlayerListener implements Listener
{ {
user.getBase().getOpenInventory().getTopInventory().clear(); user.getBase().getOpenInventory().getTopInventory().clear();
} }
if (user.hasPermission("essentials.silentquit"))
{
event.setQuitMessage(null);
}
user.updateActivity(false); user.updateActivity(false);
user.dispose(); user.dispose();
} }
@ -171,6 +175,10 @@ public class EssentialsPlayerListener implements Listener
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onPlayerJoin(final PlayerJoinEvent event) public void onPlayerJoin(final PlayerJoinEvent event)
{ {
if (event.getPlayer().hasPermission("essentials.silentjoin"))
{
event.setJoinMessage(null);
}
ess.runTaskAsynchronously(new Runnable() ess.runTaskAsynchronously(new Runnable()
{ {
@Override @Override