Remove join/quit message null checks

If you don't want to see them, don't configure them.
This commit is contained in:
Josh Roy 2021-07-06 21:31:35 -04:00
parent d4ddc87d81
commit 46a8a7d04c

View File

@ -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()) {