mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Remove join/quit message null checks
If you don't want to see them, don't configure them.
This commit is contained in:
parent
d4ddc87d81
commit
46a8a7d04c
@ -109,18 +109,26 @@ public class BukkitListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onJoin(AsyncUserDataLoadEvent event) {
|
||||
// Delay join to let nickname load
|
||||
if (event.getJoinMessage() != null && !isVanishHide(event.getUser())) {
|
||||
if (!isSilentJoinQuit(event.getUser(), "join") && !isVanishHide(event.getUser())) {
|
||||
sendJoinQuitMessage(event.getUser().getBase(), event.getJoinMessage(), true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onQuit(PlayerQuitEvent event) {
|
||||
if (event.getQuitMessage() != null && !isVanishHide(event.getPlayer())) {
|
||||
if (!isSilentJoinQuit(event.getPlayer(), "quit") && !isVanishHide(event.getPlayer())) {
|
||||
sendJoinQuitMessage(event.getPlayer(), event.getQuitMessage(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isSilentJoinQuit(final Player player, final String type) {
|
||||
return isSilentJoinQuit(jda.getPlugin().getEss().getUser(player), type);
|
||||
}
|
||||
|
||||
public boolean isSilentJoinQuit(final IUser user, final String type) {
|
||||
return jda.getPlugin().getEss().getSettings().allowSilentJoinQuit() && user.isAuthorized("essentials.silent" + type);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onVanishStatusChange(VanishStatusChangeEvent event) {
|
||||
if (!jda.getSettings().isVanishFakeJoinLeave()) {
|
||||
|
Loading…
Reference in New Issue
Block a user