From d5196e31b211b6c6031b707c2ff490db5f38de27 Mon Sep 17 00:00:00 2001 From: Iaccidentally Date: Wed, 6 Nov 2013 18:05:02 -0500 Subject: [PATCH] Add ability to supress join/leave messages :: new permissions: essentials.silentjoin & essentials.silentquit --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index fcf99355f..3eb1fd645 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -164,6 +164,10 @@ public class EssentialsPlayerListener implements Listener { user.getBase().getOpenInventory().getTopInventory().clear(); } + if (user.hasPermission("essentials.silentquit")) + { + event.setQuitMessage(null); + } user.updateActivity(false); user.dispose(); } @@ -171,6 +175,10 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(final PlayerJoinEvent event) { + if (event.getPlayer().hasPermission("essentials.silentjoin")) + { + event.setJoinMessage(null); + } ess.runTaskAsynchronously(new Runnable() { @Override