mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 17:47:34 +01:00
Add ability to supress join/leave messages :: new permissions: essentials.silentjoin & essentials.silentquit
This commit is contained in:
parent
235f134514
commit
d5196e31b2
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user