priority-messages

This commit is contained in:
ajgeiss0702
2021-08-08 13:50:09 -07:00
parent f1cbdc762b
commit 413548b588
9 changed files with 33 additions and 9 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ dependencies {
compileOnly("net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT")
compileOnly("com.google.guava:guava:30.1.1-jre")
compileOnly("us.ajg0702:ajUtils:1.1.7")
compileOnly("us.ajg0702:ajUtils:1.1.8")
compileOnly("org.slf4j:slf4j-log4j12:1.7.29")
@@ -145,6 +145,17 @@ public class QueueManagerImpl implements QueueManager {
"SERVERNAME:"+server.getName()
)
);
if(main.getConfig().getBoolean("enable-priority-messages")) {
for(String rawPriorityMessage : main.getConfig().getStringList("priority-messages")) {
String[] parts = rawPriorityMessage.split(":");
if(parts.length != 2) continue;
String level = parts[0];
String messageRaw = parts[1];
if(level.equals("*") || level.equals(queuePlayer.getPriority()+"")) {
player.sendMessage(main.getMessages().toComponent(messageRaw));
}
}
}
}
if(!server.isJoinable(player)) {
+15 -2
View File
@@ -1,5 +1,5 @@
# Dont touch this number please
config-version: 22
config-version: 23
# The time the server will wait between sending people in the queue
# Default: 5
@@ -176,4 +176,17 @@ auto-add-kick-reasons:
# Should we enable the server command being a queue command?
# This may require extra setup on bungeecord. See the wiki:
# https://wiki.ajg0702.us/ajqueue/setup/replacing-server-command
enable-server-command: false
enable-server-command: false
# Should we enable priority messages?
# Configure the priority messages in the option below.
enable-priority-messages: false
# Messages we send to players with priority queue when they join the queue
# In the free version, "priority" is 1.
# The * will send when a player joins with any priority.
# The format is <priority>:<message>
# Example: 1:You have a priority of 1!
priority-messages:
- "*:<green>Joining the queue with priority!"
- "100:<yellow>Wow! You have a priority of 100!"