Don't parse placeholder if the player is no longer online
This commit is contained in:
+1
@@ -32,6 +32,7 @@ public class EstimatedTime extends Placeholder {
|
||||
@Override
|
||||
public String parse(Matcher matcher, OfflinePlayer p) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
MessagedResponse<String> response = AjQueueSpigotAPI.getInstance()
|
||||
.getEstimatedTime(p.getUniqueId())
|
||||
|
||||
@@ -31,6 +31,7 @@ public class InQueue extends Placeholder {
|
||||
@Override
|
||||
public String parse(Matcher matcher, OfflinePlayer p) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
Boolean response = AjQueueSpigotAPI.getInstance()
|
||||
.isInQueue(p.getUniqueId())
|
||||
|
||||
@@ -32,6 +32,7 @@ public class Position extends Placeholder {
|
||||
@Override
|
||||
public String parse(Matcher matcher, OfflinePlayer p) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
MessagedResponse<Integer> response = AjQueueSpigotAPI.getInstance()
|
||||
.getPosition(p.getUniqueId())
|
||||
|
||||
@@ -32,6 +32,7 @@ public class PositionOf extends Placeholder {
|
||||
@Override
|
||||
public String parse(Matcher matcher, OfflinePlayer p) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
MessagedResponse<Integer> response = AjQueueSpigotAPI.getInstance()
|
||||
.getTotalPositions(p.getUniqueId())
|
||||
|
||||
@@ -32,6 +32,7 @@ public class Queued extends Placeholder {
|
||||
@Override
|
||||
public String parse(Matcher matcher, OfflinePlayer p) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
MessagedResponse<String> response = AjQueueSpigotAPI.getInstance()
|
||||
.getQueueName(p.getUniqueId())
|
||||
|
||||
@@ -35,6 +35,7 @@ public class QueuedFor extends Placeholder {
|
||||
String cached = cache.getOrDefault(queue, "...");
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
Integer response = AjQueueSpigotAPI.getInstance()
|
||||
.getPlayersInQueue(queue)
|
||||
|
||||
@@ -35,6 +35,7 @@ public class Status extends Placeholder {
|
||||
String cached = cache.getOrDefault(queue, "...");
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
String response = AjQueueSpigotAPI.getInstance()
|
||||
.getServerStatusString(queue)
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ public class StatusPlayer extends Placeholder {
|
||||
if(!p.isOnline()) return "You aren't online!";
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
if(!p.isOnline()) return;
|
||||
try {
|
||||
String response = AjQueueSpigotAPI.getInstance()
|
||||
.getServerStatusString(queue, p.getUniqueId())
|
||||
|
||||
Reference in New Issue
Block a user