From 7d9fabd2b984581a5bc5d1301da96e1b8c13c04c Mon Sep 17 00:00:00 2001 From: ME1312 Date: Sun, 9 Apr 2023 09:01:06 -0400 Subject: [PATCH] Fixes your assembly xml --- .../Client/Bukkit/Graphic/UIRenderer.java | 35 ++++++++++--------- .../Compatibility/AgnosticScheduler.java | 3 -- .../jar-with-some-dependencies-plus-folia.xml | 12 ++++--- .../Compatibility/AgnosticScheduler.java | 8 ++--- SubServers.Client/Universal/pom.xml | 2 +- 5 files changed, 32 insertions(+), 28 deletions(-) diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Graphic/UIRenderer.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Graphic/UIRenderer.java index d652d064..ea570fd1 100644 --- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Graphic/UIRenderer.java +++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Graphic/UIRenderer.java @@ -39,11 +39,13 @@ public abstract class UIRenderer { static final HashMap> hostPlugins = new HashMap>(); static final HashMap> serverPlugins = new HashMap>(); - private ContainedPair tdownload = null; - private final String[] adownload; - private Runnable download = null; + private final String[] downloadA; + private final int downloadL; + private int downloadF; + private String downloadT; + private Runnable download; final Player player; - SubPlugin plugin; + final SubPlugin plugin; /** * Creates a new UIRenderer @@ -74,7 +76,7 @@ public abstract class UIRenderer { TAPI_1_11 = TAPI_PLUGIN = false; } - // Pre-render Animations + // Pre-render Animation { String a = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color-Alt"); String b = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color"); @@ -108,7 +110,7 @@ public abstract class UIRenderer { break; } } while (true); - adownload = frames.toArray(new String[0]); + downloadL = (downloadA = frames.toArray(new String[0])).length; } } @@ -246,7 +248,7 @@ public abstract class UIRenderer { final String text = subtitle; if (download != null) download.run(); download = AgnosticScheduler.following(player).runs(plugin, cancel -> { - if (tdownload != null && player.isOnline()) player.sendMessage(plugin.api.getLang("SubServers", "Interface.Generic.Downloading").replace("$str$", text)); + if (downloadT != null && player.isOnline()) player.sendMessage(plugin.api.getLang("SubServers", "Interface.Generic.Downloading").replace("$str$", text)); download = null; }, 2500, TimeUnit.MILLISECONDS); return; @@ -255,16 +257,17 @@ public abstract class UIRenderer { if (!subtitle.startsWith(Character.toString(ChatColor.COLOR_CHAR))) { subtitle = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color-Alt") + subtitle; } - if (tdownload == null) { - tdownload = new ContainedPair(subtitle, 0); + if (downloadT == null) { + downloadT = subtitle; + downloadF = 0; AgnosticScheduler.following(player).repeats(plugin, cancel -> { - if (tdownload != null) { - if (++tdownload.value >= adownload.length) { - tdownload.value = 0; + if (downloadT != null) { + if (++downloadF >= downloadL) { + downloadF = 0; } - if (!sendTitle(adownload[tdownload.value], tdownload.key, 0, 10, 5)) { + if (!sendTitle(downloadA[downloadF], downloadT, 0, 10, 5)) { cancel.run(); } } else { @@ -273,11 +276,11 @@ public abstract class UIRenderer { } }, 0, 50, TimeUnit.MILLISECONDS); } else { - tdownload.key = subtitle; + downloadT = subtitle; } } else { - if (tdownload != null) { - tdownload = null; + if (downloadT != null) { + downloadT = null; } if (download != null) { download.run(); diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java index 509085d1..cdb1d92d 100644 --- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java +++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java @@ -1,7 +1,5 @@ package net.ME1312.SubServers.Client.Bukkit.Library.Compatibility; -import net.ME1312.Galaxi.Library.Try; - import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.World; @@ -16,7 +14,6 @@ import java.util.function.Consumer; * Folia Regional Scheduling Compatibility Class */ public abstract class AgnosticScheduler { - private static final boolean regional = Try.all.get(() -> Class.forName("io.papermc.paper.threadedregions.scheduler.RegionScheduler") != null); /** * Provides an asynchronous thread scheduler (in both folia and bukkit) diff --git a/SubServers.Client/Folia/jar-with-some-dependencies-plus-folia.xml b/SubServers.Client/Folia/jar-with-some-dependencies-plus-folia.xml index 50a76584..4f45c376 100644 --- a/SubServers.Client/Folia/jar-with-some-dependencies-plus-folia.xml +++ b/SubServers.Client/Folia/jar-with-some-dependencies-plus-folia.xml @@ -8,7 +8,7 @@ / - true + false true runtime @@ -18,12 +18,16 @@ + + / + ${project.build.outputDirectory} + + net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.class + + / ../../out/compile/target/SubServers.Client.Folia/classes - - ** - \ No newline at end of file diff --git a/SubServers.Client/Folia/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java b/SubServers.Client/Folia/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java index b3316a6e..cf614f66 100644 --- a/SubServers.Client/Folia/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java +++ b/SubServers.Client/Folia/src/net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.java @@ -189,14 +189,14 @@ public abstract class AgnosticScheduler { } @Override public Runnable repeats(Plugin plugin, Consumer task, long repeat) { - final long rMS; - return repeats(plugin, task, rMS = repeat * 50, repeat, rMS, repeat); + final long ms; + return repeats(plugin, task, ms = repeat * 50, repeat, ms, repeat); } @Override public Runnable repeats(Plugin plugin, Consumer task, long repeat, TimeUnit units) { - final long rT; - return repeats(plugin, task, repeat = units.toMillis(repeat), rT = repeat / 50, repeat, rT); + final long ticks; + return repeats(plugin, task, repeat = units.toMillis(repeat), ticks = repeat / 50, repeat, ticks); } @Override diff --git a/SubServers.Client/Universal/pom.xml b/SubServers.Client/Universal/pom.xml index 0a066905..71f908b5 100644 --- a/SubServers.Client/Universal/pom.xml +++ b/SubServers.Client/Universal/pom.xml @@ -45,7 +45,7 @@ MANIFEST.MF - ../Folia/jar-with-some-dependencies-plus-folia.xml + ../Common/jar-with-some-dependencies.xml false