Add setting to remove quit messages for unlogged players

#833
This commit is contained in:
Gabriele C 2016-08-07 12:04:20 +02:00
parent eef314b965
commit 168186321c
2 changed files with 9 additions and 1 deletions

View File

@ -248,6 +248,10 @@ public class PlayerListener implements Listener {
if (settings.getProperty(RegistrationSettings.REMOVE_LEAVE_MESSAGE)) { if (settings.getProperty(RegistrationSettings.REMOVE_LEAVE_MESSAGE)) {
event.setQuitMessage(null); event.setQuitMessage(null);
} else if (settings.getProperty(RegistrationSettings.REMOVE_UNLOGGED_LEAVE_MESSAGE)) {
if(listenerService.shouldCancelEvent(event)) {
event.setQuitMessage(null);
}
} }
if (antiBot.wasPlayerKicked(player.getName())) { if (antiBot.wasPlayerKicked(player.getName())) {

View File

@ -84,11 +84,15 @@ public class RegistrationSettings implements SettingsClass {
public static final Property<Boolean> DELAY_JOIN_MESSAGE = public static final Property<Boolean> DELAY_JOIN_MESSAGE =
newProperty("settings.delayJoinMessage", false); newProperty("settings.delayJoinMessage", false);
@Comment("Should we remove leave messages for unlogged users?")
public static final Property<Boolean> REMOVE_UNLOGGED_LEAVE_MESSAGE =
newProperty("settings.removeUnloggedLeaveMessage", false);
@Comment("Should we remove join messages altogether?") @Comment("Should we remove join messages altogether?")
public static final Property<Boolean> REMOVE_JOIN_MESSAGE = public static final Property<Boolean> REMOVE_JOIN_MESSAGE =
newProperty("settings.removeJoinMessage", false); newProperty("settings.removeJoinMessage", false);
@Comment("Should we remove leave messages?") @Comment("Should we remove leave messages altogether?")
public static final Property<Boolean> REMOVE_LEAVE_MESSAGE = public static final Property<Boolean> REMOVE_LEAVE_MESSAGE =
newProperty("settings.removeLeaveMessage", false); newProperty("settings.removeLeaveMessage", false);