Merge pull request #7 from unilock/server-name-join-msg
Allow using server name in join and leave messages
This commit is contained in:
commit
79b542d052
@ -53,11 +53,13 @@ public final class Listeners {
|
||||
return;
|
||||
}
|
||||
Player p = e.getPlayer();
|
||||
if (p.getCurrentServer().isEmpty()) {
|
||||
Optional<ServerConnection> server = p.getCurrentServer();
|
||||
if (server.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String message = configuration.getLeaveFormat()
|
||||
.replace("#player#", p.getUsername());
|
||||
.replace("#player#", p.getUsername())
|
||||
.replace("#oldserver#", server.get().getServerInfo().getName());
|
||||
if (luckPermsAPI != null) {
|
||||
message = luckperms(message, p);
|
||||
}
|
||||
@ -98,7 +100,9 @@ public final class Listeners {
|
||||
if (!configuration.isJoinEnabled()) {
|
||||
return;
|
||||
}
|
||||
String message = configuration.getJoinFormat().replace("#player#", p.getUsername());
|
||||
String message = configuration.getJoinFormat()
|
||||
.replace("#player#", p.getUsername())
|
||||
.replace("#server#", actual.getServerInfo().getName());
|
||||
if (luckPermsAPI != null) {
|
||||
message = luckperms(message, p);
|
||||
}
|
||||
|
@ -14,16 +14,18 @@ enabled = true
|
||||
[Join]
|
||||
#place holders:
|
||||
#- "#player#" : return the player name
|
||||
#- "#server#" : return the new player's server name
|
||||
#- "#prefix#" : return the player's luckperms prefix
|
||||
#- "#suffix#" : return the player's luckperms suffix
|
||||
format = "&7#prefix# #player# &ejoined the network"
|
||||
format = "&7#prefix# #player# &ejoined &7#server#"
|
||||
enabled = true
|
||||
[Leave]
|
||||
#place holders:
|
||||
#- "#player#" : return the player name
|
||||
#- "#oldserver#" : return the previous player's server name
|
||||
#- "#prefix#" : return the player's luckperms prefix
|
||||
#- "#suffix#" : return the player's luckperms suffix
|
||||
format = "#&7prefix# #player# &eleft the network"
|
||||
format = "#&7prefix# #player# &eleft &7#oldserver#"
|
||||
enabled = true
|
||||
[Server-change]
|
||||
#place holders:
|
||||
@ -33,4 +35,4 @@ enabled = true
|
||||
#- "#oldserver#" : return the previous player's server name
|
||||
#- "#server#" : return the new player's server name
|
||||
format = "&7#prefix# #player# &eleft &c#oldserver# &eto join &a#server#"
|
||||
enabled = true
|
||||
enabled = true
|
||||
|
Loading…
Reference in New Issue
Block a user