Fixes your assembly xml

This commit is contained in:
ME1312 2023-04-09 09:01:06 -04:00
parent b23aa18661
commit 7d9fabd2b9
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
5 changed files with 32 additions and 28 deletions

View File

@ -39,11 +39,13 @@ public abstract class UIRenderer {
static final HashMap<String, PluginRenderer<Host>> hostPlugins = new HashMap<String, PluginRenderer<Host>>(); static final HashMap<String, PluginRenderer<Host>> hostPlugins = new HashMap<String, PluginRenderer<Host>>();
static final HashMap<String, PluginRenderer<Server>> serverPlugins = new HashMap<String, PluginRenderer<Server>>(); static final HashMap<String, PluginRenderer<Server>> serverPlugins = new HashMap<String, PluginRenderer<Server>>();
private ContainedPair<String, Integer> tdownload = null; private final String[] downloadA;
private final String[] adownload; private final int downloadL;
private Runnable download = null; private int downloadF;
private String downloadT;
private Runnable download;
final Player player; final Player player;
SubPlugin plugin; final SubPlugin plugin;
/** /**
* Creates a new UIRenderer * Creates a new UIRenderer
@ -74,7 +76,7 @@ public abstract class UIRenderer {
TAPI_1_11 = TAPI_PLUGIN = false; 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 a = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color-Alt");
String b = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color"); String b = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color");
@ -108,7 +110,7 @@ public abstract class UIRenderer {
break; break;
} }
} while (true); } 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; final String text = subtitle;
if (download != null) download.run(); if (download != null) download.run();
download = AgnosticScheduler.following(player).runs(plugin, cancel -> { 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; download = null;
}, 2500, TimeUnit.MILLISECONDS); }, 2500, TimeUnit.MILLISECONDS);
return; return;
@ -255,16 +257,17 @@ public abstract class UIRenderer {
if (!subtitle.startsWith(Character.toString(ChatColor.COLOR_CHAR))) { if (!subtitle.startsWith(Character.toString(ChatColor.COLOR_CHAR))) {
subtitle = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color-Alt") + subtitle; subtitle = plugin.api.getLang("SubServers", "Interface.Generic.Downloading.Title-Color-Alt") + subtitle;
} }
if (tdownload == null) { if (downloadT == null) {
tdownload = new ContainedPair<String, Integer>(subtitle, 0); downloadT = subtitle;
downloadF = 0;
AgnosticScheduler.following(player).repeats(plugin, cancel -> { AgnosticScheduler.following(player).repeats(plugin, cancel -> {
if (tdownload != null) { if (downloadT != null) {
if (++tdownload.value >= adownload.length) { if (++downloadF >= downloadL) {
tdownload.value = 0; downloadF = 0;
} }
if (!sendTitle(adownload[tdownload.value], tdownload.key, 0, 10, 5)) { if (!sendTitle(downloadA[downloadF], downloadT, 0, 10, 5)) {
cancel.run(); cancel.run();
} }
} else { } else {
@ -273,11 +276,11 @@ public abstract class UIRenderer {
} }
}, 0, 50, TimeUnit.MILLISECONDS); }, 0, 50, TimeUnit.MILLISECONDS);
} else { } else {
tdownload.key = subtitle; downloadT = subtitle;
} }
} else { } else {
if (tdownload != null) { if (downloadT != null) {
tdownload = null; downloadT = null;
} }
if (download != null) { if (download != null) {
download.run(); download.run();

View File

@ -1,7 +1,5 @@
package net.ME1312.SubServers.Client.Bukkit.Library.Compatibility; package net.ME1312.SubServers.Client.Bukkit.Library.Compatibility;
import net.ME1312.Galaxi.Library.Try;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
@ -16,7 +14,6 @@ import java.util.function.Consumer;
* Folia Regional Scheduling Compatibility Class * Folia Regional Scheduling Compatibility Class
*/ */
public abstract class AgnosticScheduler { 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) * Provides an asynchronous thread scheduler (in both folia and bukkit)

View File

@ -8,7 +8,7 @@
<dependencySets> <dependencySets>
<dependencySet> <dependencySet>
<outputDirectory>/</outputDirectory> <outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact> <useProjectArtifact>false</useProjectArtifact>
<unpack>true</unpack> <unpack>true</unpack>
<scope>runtime</scope> <scope>runtime</scope>
<excludes> <excludes>
@ -18,12 +18,16 @@
</dependencySet> </dependencySet>
</dependencySets> </dependencySets>
<fileSets> <fileSets>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>${project.build.outputDirectory}</directory>
<excludes>
<exclude>net/ME1312/SubServers/Client/Bukkit/Library/Compatibility/AgnosticScheduler.class</exclude>
</excludes>
</fileSet>
<fileSet> <fileSet>
<outputDirectory>/</outputDirectory> <outputDirectory>/</outputDirectory>
<directory>../../out/compile/target/SubServers.Client.Folia/classes</directory> <directory>../../out/compile/target/SubServers.Client.Folia/classes</directory>
<includes>
<include>**</include>
</includes>
</fileSet> </fileSet>
</fileSets> </fileSets>
</assembly> </assembly>

View File

@ -189,14 +189,14 @@ public abstract class AgnosticScheduler {
} }
@Override @Override
public Runnable repeats(Plugin plugin, Consumer<Runnable> task, long repeat) { public Runnable repeats(Plugin plugin, Consumer<Runnable> task, long repeat) {
final long rMS; final long ms;
return repeats(plugin, task, rMS = repeat * 50, repeat, rMS, repeat); return repeats(plugin, task, ms = repeat * 50, repeat, ms, repeat);
} }
@Override @Override
public Runnable repeats(Plugin plugin, Consumer<Runnable> task, long repeat, TimeUnit units) { public Runnable repeats(Plugin plugin, Consumer<Runnable> task, long repeat, TimeUnit units) {
final long rT; final long ticks;
return repeats(plugin, task, repeat = units.toMillis(repeat), rT = repeat / 50, repeat, rT); return repeats(plugin, task, repeat = units.toMillis(repeat), ticks = repeat / 50, repeat, ticks);
} }
@Override @Override

View File

@ -45,7 +45,7 @@
<manifestFile>MANIFEST.MF</manifestFile> <manifestFile>MANIFEST.MF</manifestFile>
</archive> </archive>
<descriptors> <descriptors>
<descriptor>../Folia/jar-with-some-dependencies-plus-folia.xml</descriptor> <descriptor>../Common/jar-with-some-dependencies.xml</descriptor>
</descriptors> </descriptors>
<appendAssemblyId>false</appendAssemblyId> <appendAssemblyId>false</appendAssemblyId>
</configuration> </configuration>