added the "all" option
This commit is contained in:
parent
06691820c0
commit
58de2ea259
@ -18,6 +18,7 @@ public final class Configuration {
|
||||
private boolean leaveEnabled;
|
||||
private boolean changeEnabled;
|
||||
private boolean minimessage;
|
||||
private boolean all;
|
||||
private Toml config;
|
||||
private static File file;
|
||||
|
||||
@ -33,6 +34,7 @@ public final class Configuration {
|
||||
changeEnabled = config.getBoolean("Server-change.enabled", false);
|
||||
|
||||
minimessage = config.getBoolean("Message-format.minimessage");
|
||||
all = config.getBoolean("Message.all", false);
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@ -98,6 +100,9 @@ public final class Configuration {
|
||||
public boolean isMinimessageEnabled(){
|
||||
return this.minimessage;
|
||||
}
|
||||
public boolean isAllEnabled(){
|
||||
return this.all;
|
||||
}
|
||||
void reload(){
|
||||
config = config.read(file);
|
||||
this.messageFormat = config.getString("Message.format");
|
||||
@ -111,5 +116,6 @@ public final class Configuration {
|
||||
this.changeEnabled = config.getBoolean("Server-change.enabled");
|
||||
|
||||
this.minimessage = config.getBoolean("Message-format.minimessage");
|
||||
all = config.getBoolean("Message.all", false);
|
||||
}
|
||||
}
|
||||
|
@ -132,10 +132,15 @@ public final class Listeners {
|
||||
} else {
|
||||
finalMessage = SERIALIZER.deserialize(message);
|
||||
}
|
||||
proxyServer.getAllServers().forEach(server -> {
|
||||
if (!Objects.equals(p.getCurrentServer().map(ServerConnection::getServerInfo).orElse(null), server.getServerInfo())) {
|
||||
server.sendMessage(finalMessage);
|
||||
}
|
||||
});
|
||||
if(configuration.isAllEnabled()){
|
||||
proxyServer.getAllServers().forEach(server -> server.sendMessage(finalMessage));
|
||||
}else {
|
||||
proxyServer.getAllServers().forEach(server -> {
|
||||
if (!Objects.equals(p.getCurrentServer().map(ServerConnection::getServerInfo).orElse(null), server.getServerInfo())) {
|
||||
server.sendMessage(finalMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import java.nio.file.Path;
|
||||
@Plugin(
|
||||
id = "vmessage",
|
||||
name = "Vmessage",
|
||||
version = "1.5.1",
|
||||
version = "1.5.2",
|
||||
description = "A velocity plugin that creates a multi server chat for the network",
|
||||
authors = {"FeuSalamander"},
|
||||
dependencies = { @Dependency(id = "luckperms", optional = true) }
|
||||
|
@ -9,6 +9,7 @@ minimessage = false
|
||||
#- "#message#" : return the player's message
|
||||
#- "#server#" : return the player's server name
|
||||
format = "&a(#server#) #prefix# #player# &8&l> &r#message#"
|
||||
all = false #if the formated message is sent even in the server where the player is located (can cause some issues with other plugins)
|
||||
enabled = true
|
||||
[Join]
|
||||
#place holders:
|
||||
|
Loading…
Reference in New Issue
Block a user