diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 2392b5c5..08c6659c 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { implementation("net.kyori:adventure-text-serializer-plain:4.13.1") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.2.14") + compileOnly("us.ajg0702:ajUtils:1.2.25") } publishing { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index d39f3187..ca523883 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { compileOnly("net.kyori:adventure-text-serializer-plain:4.13.1") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.2.14") + compileOnly("us.ajg0702:ajUtils:1.2.25") compileOnly("org.slf4j:slf4j-log4j12:1.7.29") diff --git a/free/build.gradle.kts b/free/build.gradle.kts index bf8eb31c..a71afc4b 100644 --- a/free/build.gradle.kts +++ b/free/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { compileOnly("com.google.guava:guava:30.1.1-jre") compileOnly("org.spongepowered:configurate-yaml:4.0.0") - implementation("us.ajg0702:ajUtils:1.2.14") + implementation("us.ajg0702:ajUtils:1.2.25") implementation(project(":platforms:velocity")) implementation(project(":platforms:bungeecord")) diff --git a/platforms/bungeecord/build.gradle.kts b/platforms/bungeecord/build.gradle.kts index bd055baf..57732c07 100644 --- a/platforms/bungeecord/build.gradle.kts +++ b/platforms/bungeecord/build.gradle.kts @@ -16,7 +16,7 @@ repositories { dependencies { compileOnly("net.kyori:adventure-api:4.13.1") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.2.14") + compileOnly("us.ajg0702:ajUtils:1.2.25") compileOnly("net.md-5:bungeecord-api:1.16-R0.4") diff --git a/platforms/velocity/build.gradle.kts b/platforms/velocity/build.gradle.kts index 162e3b22..9adf3eec 100644 --- a/platforms/velocity/build.gradle.kts +++ b/platforms/velocity/build.gradle.kts @@ -16,7 +16,7 @@ repositories { dependencies { compileOnly("net.kyori:adventure-api:4.13.1") compileOnly("com.google.guava:guava:30.1.1-jre") - compileOnly("us.ajg0702:ajUtils:1.2.14") + compileOnly("us.ajg0702:ajUtils:1.2.25") compileOnly("com.velocitypowered:velocity-api:3.1.1") annotationProcessor("com.velocitypowered:velocity-api:3.1.1") diff --git a/premium/build.gradle.kts b/premium/build.gradle.kts index 92c3e01f..9268722d 100644 --- a/premium/build.gradle.kts +++ b/premium/build.gradle.kts @@ -24,7 +24,7 @@ dependencies { compileOnly("me.TechsCode:FakeUltraPerms:1.0.2") - compileOnly("us.ajg0702:ajUtils:1.2.14") + compileOnly("us.ajg0702:ajUtils:1.2.25") compileOnly("net.kyori:adventure-api:4.13.1") diff --git a/spigot/build.gradle.kts b/spigot/build.gradle.kts index 2535b311..faeb387f 100644 --- a/spigot/build.gradle.kts +++ b/spigot/build.gradle.kts @@ -25,7 +25,7 @@ dependencies { compileOnly("org.spongepowered:configurate-yaml:4.1.2") - compileOnly("us.ajg0702:ajUtils:1.2.14") + compileOnly("us.ajg0702:ajUtils:1.2.25") compileOnly(group = "org.spigotmc", name = "spigot", version = "1.16.5-R0.1-SNAPSHOT") compileOnly("me.clip:placeholderapi:2.10.4") diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java b/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java index fb5c169a..bbae7e60 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/Placeholders.java @@ -136,7 +136,7 @@ public String onPlaceholderRequest(Player player, final String identifier){ } } - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { HashMap playerCache; if(responseCache.containsKey(player)) { playerCache = responseCache.get(player); @@ -147,7 +147,7 @@ public String onPlaceholderRequest(Player player, final String identifier){ try { playerCache.remove(playerCache.keySet().toArray()[0]); } catch(ConcurrentModificationException e) { - Bukkit.getScheduler().runTask(plugin, () -> playerCache.remove(playerCache.keySet().toArray()[0])); + plugin.getScheduler().runTaskAsynchronously(() -> playerCache.remove(playerCache.keySet().toArray()[0])); } } String resp = parsePlaceholder(player, identifier); diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java b/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java index 63257aa4..4103f03e 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/SpigotMain.java @@ -22,6 +22,7 @@ import us.ajg0702.queue.spigot.communication.ResponseManager; import us.ajg0702.queue.spigot.placeholders.PlaceholderExpansion; import us.ajg0702.utils.common.ConfigFile; +import us.ajg0702.utils.foliacompat.CompatScheduler; import java.io.File; import java.util.HashMap; @@ -34,6 +35,8 @@ public class SpigotMain extends JavaPlugin implements PluginMessageListener,List private PlaceholderExpansion placeholders; private ResponseManager responseManager = new ResponseManager(); + + private final CompatScheduler compatScheduler = new CompatScheduler(this); private ConfigFile config; @@ -60,7 +63,7 @@ public void onEnable() { getLogger().info("Registered PlaceholderAPI placeholders"); } - Bukkit.getScheduler().runTaskTimer(this, () -> { + getScheduler().runTaskTimerAsynchronously(() -> { if(Bukkit.getOnlinePlayers().size() <= 0 || queuebatch.size() <= 0) return; StringBuilder msg = new StringBuilder(); for(Player p : queuebatch.keySet()) { @@ -153,7 +156,7 @@ public void onLeave(PlayerQuitEvent e) { @EventHandler public void onJoin(PlayerJoinEvent e) { if(hasProxy) return; - Bukkit.getScheduler().runTaskLater(this, () -> sendMessage(e.getPlayer(), "ack", ""), 5); + getScheduler().runTaskLaterAsynchronously(() -> sendMessage(e.getPlayer(), "ack", ""), 5); } @EventHandler(priority = EventPriority.HIGH) @@ -175,6 +178,9 @@ public void onServerPing(ServerListPingEvent e) { e.setMotd("ajQueue;whitelisted="+whitelist); } + public CompatScheduler getScheduler() { + return compatScheduler; + } public ConfigFile getAConfig() { return config; diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/EstimatedTime.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/EstimatedTime.java index a9e1ebb0..42362164 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/EstimatedTime.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/EstimatedTime.java @@ -31,7 +31,7 @@ public String getRegex() { @Override public String parse(Matcher matcher, OfflinePlayer p) { - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { MessagedResponse response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/InQueue.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/InQueue.java index 7ebd222e..7d4cb34b 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/InQueue.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/InQueue.java @@ -30,7 +30,7 @@ public String getRegex() { @Override public String parse(Matcher matcher, OfflinePlayer p) { - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { Boolean response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Position.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Position.java index 1dbf949d..47f8b59a 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Position.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Position.java @@ -31,7 +31,7 @@ public String getRegex() { @Override public String parse(Matcher matcher, OfflinePlayer p) { - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { MessagedResponse response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/PositionOf.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/PositionOf.java index 64a34ce6..f7a2a9ce 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/PositionOf.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/PositionOf.java @@ -31,7 +31,7 @@ public String getRegex() { @Override public String parse(Matcher matcher, OfflinePlayer p) { - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { MessagedResponse response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Queued.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Queued.java index 91d895bd..734297f2 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Queued.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Queued.java @@ -31,7 +31,7 @@ public String getRegex() { @Override public String parse(Matcher matcher, OfflinePlayer p) { - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { MessagedResponse response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/QueuedFor.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/QueuedFor.java index 7dfb3ad9..9afe22fb 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/QueuedFor.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/QueuedFor.java @@ -34,7 +34,7 @@ public String parse(Matcher matcher, OfflinePlayer p) { String queue = matcher.group(1); String cached = cache.getOrDefault(queue, "..."); - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { Integer response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Status.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Status.java index 41575e0e..d075b908 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Status.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/Status.java @@ -34,7 +34,7 @@ public String parse(Matcher matcher, OfflinePlayer p) { String queue = matcher.group(1); String cached = cache.getOrDefault(queue, "..."); - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { String response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/StatusPlayer.java b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/StatusPlayer.java index a1a0befe..b2b74b5d 100644 --- a/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/StatusPlayer.java +++ b/spigot/src/main/java/us/ajg0702/queue/spigot/placeholders/placeholders/StatusPlayer.java @@ -37,7 +37,7 @@ public String parse(Matcher matcher, OfflinePlayer p) { if(!p.isOnline()) return "You aren't online!"; - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + plugin.getScheduler().runTaskAsynchronously(() -> { if(!p.isOnline()) return; try { String response = AjQueueSpigotAPI.getInstance() diff --git a/spigot/src/main/resources/plugin.yml b/spigot/src/main/resources/plugin.yml index 4b705782..6bb54a2b 100644 --- a/spigot/src/main/resources/plugin.yml +++ b/spigot/src/main/resources/plugin.yml @@ -3,6 +3,7 @@ version: "@VERSION@" api-version: 1.13 author: ajgeiss0702 name: ajQueue +folia-supported: true softdepend: [PlaceholderAPI] commands: queue: