Add config option for new username join messages (#4290)

Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This commit is contained in:
Olivia 2021-07-07 10:46:54 -05:00 committed by GitHub
parent 5e178943a0
commit ff58d8e443
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 3 deletions

View file

@ -116,6 +116,8 @@ public class Settings implements net.ess3.api.ISettings {
private boolean isCustomJoinMessage;
private String customQuitMessage;
private boolean isCustomQuitMessage;
private String customNewUsernameMessage;
private boolean isCustomNewUsernameMessage;
private List<String> spawnOnJoinGroups;
private Map<Pattern, Long> commandCooldowns;
private boolean npcsInBalanceRanking = false;
@ -717,6 +719,8 @@ public class Settings implements net.ess3.api.ISettings {
isCustomJoinMessage = !customJoinMessage.equals("none");
customQuitMessage = _getCustomQuitMessage();
isCustomQuitMessage = !customQuitMessage.equals("none");
customNewUsernameMessage = _getCustomNewUsernameMessage();
isCustomNewUsernameMessage = !customNewUsernameMessage.equals("none");
muteCommands = _getMuteCommands();
spawnOnJoinGroups = _getSpawnOnJoinGroups();
commandCooldowns = _getCommandCooldowns();
@ -1372,6 +1376,20 @@ public class Settings implements net.ess3.api.ISettings {
return isCustomQuitMessage;
}
public String _getCustomNewUsernameMessage() {
return FormatUtil.replaceFormat(config.getString("custom-new-username-message", "none"));
}
@Override
public String getCustomNewUsernameMessage() {
return customNewUsernameMessage;
}
@Override
public boolean isCustomNewUsernameMessage() {
return isCustomNewUsernameMessage;
}
@Override
public boolean isCustomServerFullMessage() {
return config.getBoolean("use-custom-server-full-message", true);