Add minimessage support
This commit is contained in:
+3
-1
@@ -9,6 +9,7 @@ version = "1.9.7"
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
|
||||||
maven { url = uri("https://jitpack.io") }
|
maven { url = uri("https://jitpack.io") }
|
||||||
maven { url = uri("https://gitlab.com/api/v4/projects/19978391/packages/maven") }
|
maven { url = uri("https://gitlab.com/api/v4/projects/19978391/packages/maven") }
|
||||||
@@ -26,7 +27,7 @@ dependencies {
|
|||||||
compileOnly(group = "org.spigotmc", name = "spigot", version = "1.16.5-R0.1-SNAPSHOT")
|
compileOnly(group = "org.spigotmc", name = "spigot", version = "1.16.5-R0.1-SNAPSHOT")
|
||||||
compileOnly("me.clip:placeholderapi:2.10.4")
|
compileOnly("me.clip:placeholderapi:2.10.4")
|
||||||
|
|
||||||
implementation("us.ajg0702:ajUtils:1.0.0")
|
implementation("us.ajg0702:ajUtils:1.0.4")
|
||||||
implementation("org.bstats:bstats-bungeecord:2.2.1")
|
implementation("org.bstats:bstats-bungeecord:2.2.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ tasks.withType<ProcessResources> {
|
|||||||
tasks.shadowJar {
|
tasks.shadowJar {
|
||||||
relocate("us.ajg0702.utils", "us.ajg0702.queue.utils")
|
relocate("us.ajg0702.utils", "us.ajg0702.queue.utils")
|
||||||
relocate("org.bstats", "us.ajg0702.bstats")
|
relocate("org.bstats", "us.ajg0702.bstats")
|
||||||
|
relocate("net.kyori", "us.ajg0702.queue.kyori")
|
||||||
archiveFileName.set("${baseName}-${version}.${extension}")
|
archiveFileName.set("${baseName}-${version}.${extension}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,7 @@ import us.ajg0702.queue.commands.LeaveCommand;
|
|||||||
import us.ajg0702.queue.commands.ListCommand;
|
import us.ajg0702.queue.commands.ListCommand;
|
||||||
import us.ajg0702.queue.commands.ManageCommand;
|
import us.ajg0702.queue.commands.ManageCommand;
|
||||||
import us.ajg0702.queue.commands.MoveCommand;
|
import us.ajg0702.queue.commands.MoveCommand;
|
||||||
import us.ajg0702.utils.bungee.BungeeConfig;
|
import us.ajg0702.utils.bungee.*;
|
||||||
import us.ajg0702.utils.bungee.BungeeMessages;
|
|
||||||
import us.ajg0702.utils.bungee.BungeeStats;
|
|
||||||
import us.ajg0702.utils.bungee.BungeeUtils;
|
|
||||||
|
|
||||||
public class Main extends Plugin implements Listener {
|
public class Main extends Plugin implements Listener {
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ public class Manager {
|
|||||||
public String getQueuedName(ProxiedPlayer p) {
|
public String getQueuedName(ProxiedPlayer p) {
|
||||||
List<QueueServer> queued = findPlayerInQueue(p);
|
List<QueueServer> queued = findPlayerInQueue(p);
|
||||||
if(queued.size() <= 0) {
|
if(queued.size() <= 0) {
|
||||||
return msgs.get("placeholders.queued.none");
|
return msgs.getString("placeholders.queued.none");
|
||||||
}
|
}
|
||||||
QueueServer selected = queued.get(0);
|
QueueServer selected = queued.get(0);
|
||||||
|
|
||||||
@@ -281,23 +281,23 @@ public class Manager {
|
|||||||
|
|
||||||
|
|
||||||
if(!s.canAccess(p)) {
|
if(!s.canAccess(p)) {
|
||||||
status = msgs.get("status.offline.restricted");
|
status = msgs.getString("status.offline.restricted");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s.isFull()) {
|
if(s.isFull()) {
|
||||||
status = msgs.get("status.offline.full");
|
status = msgs.getString("status.offline.full");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s.isPaused()) {
|
if(s.isPaused()) {
|
||||||
status = msgs.get("status.offline.paused");
|
status = msgs.getString("status.offline.paused");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!s.isOnline()) {
|
if(!s.isOnline()) {
|
||||||
status = msgs.get("status.offline.restarting");
|
status = msgs.getString("status.offline.restarting");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s.getOfflineTime() > pl.config.getInt("offline-time")) {
|
if(s.getOfflineTime() > pl.config.getInt("offline-time")) {
|
||||||
status = msgs.get("status.offline.offline");
|
status = msgs.getString("status.offline.offline");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -308,15 +308,15 @@ public class Manager {
|
|||||||
"STATUS:"+status));
|
"STATUS:"+status));
|
||||||
} else {
|
} else {
|
||||||
int time = (int) Math.round(pos*pl.timeBetweenPlayers);
|
int time = (int) Math.round(pos*pl.timeBetweenPlayers);
|
||||||
int min = (int) Math.floor((time) / (60));
|
int min = (int) Math.floor((time) / (60.0));
|
||||||
int sec = (int) Math.floor((time % (60)));
|
int sec = (int) Math.floor((time % (60.0)));
|
||||||
String timeStr;
|
String timeStr;
|
||||||
if(min <= 0) {
|
if(min <= 0) {
|
||||||
timeStr = msgs.get("format.time.secs")
|
timeStr = msgs.getString("format.time.secs")
|
||||||
.replaceAll("\\{m\\}", "0")
|
.replaceAll("\\{m\\}", "0")
|
||||||
.replaceAll("\\{s\\}", sec+"");
|
.replaceAll("\\{s\\}", sec+"");
|
||||||
} else {
|
} else {
|
||||||
timeStr = msgs.get("format.time.mins")
|
timeStr = msgs.getString("format.time.mins")
|
||||||
.replaceAll("\\{m\\}", min+"")
|
.replaceAll("\\{m\\}", min+"")
|
||||||
.replaceAll("\\{s\\}", sec+"");
|
.replaceAll("\\{s\\}", sec+"");
|
||||||
}
|
}
|
||||||
@@ -375,54 +375,52 @@ public class Manager {
|
|||||||
int ot = s.getOfflineTime();
|
int ot = s.getOfflineTime();
|
||||||
if(!s.isJoinable(ply)) {
|
if(!s.isJoinable(ply)) {
|
||||||
|
|
||||||
String status = msgs.get("status.offline.restarting");
|
String status = msgs.getString("status.offline.restarting");
|
||||||
|
|
||||||
if(ot > pl.config.getInt("offline-time")) {
|
if(ot > pl.config.getInt("offline-time")) {
|
||||||
status = msgs.get("status.offline.offline");
|
status = msgs.getString("status.offline.offline");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s.isFull() && s.isOnline()) {
|
if(s.isFull() && s.isOnline()) {
|
||||||
status = msgs.get("status.offline.full");
|
status = msgs.getString("status.offline.full");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!s.canAccess(ply)) {
|
if(!s.canAccess(ply)) {
|
||||||
status = msgs.get("status.offline.restricted");
|
status = msgs.getString("status.offline.restricted");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s.isPaused()) {
|
if(s.isPaused()) {
|
||||||
status = msgs.get("status.offline.paused");
|
status = msgs.getString("status.offline.paused");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(status.isEmpty()) return;
|
if(status.isEmpty()) return;
|
||||||
|
|
||||||
ply.sendMessage(Main.formatMessage(
|
ply.sendMessage(msgs.getBC("status.offline.base",
|
||||||
msgs.get("status.offline.base")
|
"STATUS:"+status,
|
||||||
.replaceAll("\\{STATUS\\}", status)
|
"POS:"+pos,
|
||||||
.replaceAll("\\{POS\\}", pos+"")
|
"LEN:"+len,
|
||||||
.replaceAll("\\{LEN\\}", len+"")
|
"SERVER:"+pl.aliases.getAlias(s.getName())
|
||||||
.replaceAll("\\{SERVER\\}", pl.aliases.getAlias(s.getName()))
|
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
if(msgs.get("spigot.actionbar.offline").isEmpty()) return;
|
if(msgs.getString("spigot.actionbar.offline").isEmpty()) return;
|
||||||
int time = (int) Math.round(pos*pl.timeBetweenPlayers);
|
int time = (int) Math.round(pos*pl.timeBetweenPlayers);
|
||||||
int min = (int) Math.floor((time) / (60));
|
int min = (int) Math.floor((time) / (60));
|
||||||
int sec = (int) Math.floor((time % (60)));
|
int sec = (int) Math.floor((time % (60)));
|
||||||
String timeStr;
|
String timeStr;
|
||||||
if(min <= 0) {
|
if(min <= 0) {
|
||||||
timeStr = msgs.get("format.time.secs")
|
timeStr = msgs.getString("format.time.secs")
|
||||||
.replaceAll("\\{m\\}", "0")
|
.replaceAll("\\{m\\}", "0")
|
||||||
.replaceAll("\\{s\\}", sec+"");
|
.replaceAll("\\{s\\}", sec+"");
|
||||||
} else {
|
} else {
|
||||||
timeStr = msgs.get("format.time.mins")
|
timeStr = msgs.getString("format.time.mins")
|
||||||
.replaceAll("\\{m\\}", min+"")
|
.replaceAll("\\{m\\}", min+"")
|
||||||
.replaceAll("\\{s\\}", sec+"");
|
.replaceAll("\\{s\\}", sec+"");
|
||||||
}
|
}
|
||||||
ply.sendMessage(Main.formatMessage(
|
ply.sendMessage(msgs.getBC("status.online.base",
|
||||||
msgs.get("status.online.base")
|
"TIME:"+timeStr,
|
||||||
.replaceAll("\\{POS\\}", pos+"")
|
"POS:"+pos,
|
||||||
.replaceAll("\\{LEN\\}", len+"")
|
"LEN:"+len,
|
||||||
.replaceAll("\\{TIME\\}", timeStr)
|
"SERVER:"+pl.aliases.getAlias(s.getName())
|
||||||
.replaceAll("\\{SERVER\\}", pl.aliases.getAlias(s.getName()))
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -659,10 +657,9 @@ public class Manager {
|
|||||||
if(list.indexOf(p) != -1) {
|
if(list.indexOf(p) != -1) {
|
||||||
int pos = list.indexOf(p)+1;
|
int pos = list.indexOf(p)+1;
|
||||||
int len = list.size();
|
int len = list.size();
|
||||||
p.sendMessage(Main.formatMessage(
|
p.sendMessage(msgs.getBC("errors.already-queued",
|
||||||
msgs.get("errors.already-queued")
|
"POS:"+pos,
|
||||||
.replaceAll("\\{POS\\}", pos+"")
|
"LEN:"+len
|
||||||
.replaceAll("\\{LEN\\}", len+"")
|
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -709,12 +706,10 @@ public class Manager {
|
|||||||
p.sendMessage(m);
|
p.sendMessage(m);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//p.sendMessage(Main.formatMessage("now in queue, not send instant"));
|
p.sendMessage(msgs.getBC("status.now-in-queue",
|
||||||
p.sendMessage(Main.formatMessage(
|
"POS:"+pos,
|
||||||
msgs.get("status.now-in-queue")
|
"LEN:"+len,
|
||||||
.replaceAll("\\{POS\\}", pos+"")
|
"SERVER:"+pl.aliases.getAlias(server.getName())
|
||||||
.replaceAll("\\{LEN\\}", len+"")
|
|
||||||
.replaceAll("\\{SERVER\\}", pl.aliases.getAlias(s))
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
//p.sendMessage(Main.formatMessage(sendInstant+" && ("+sendInstantp+" && " + timeGood+")"));
|
//p.sendMessage(Main.formatMessage(sendInstant+" && ("+sendInstantp+" && " + timeGood+")"));
|
||||||
|
|||||||
Reference in New Issue
Block a user