mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Expose the platform's Gson to pack modules in the Bukkit jar
The Bukkit jar relocates Iris's own Gson, and the relocation rewrote the package name in the exposed list, so modules were shown Iris's copy and every reference to com.google.gson failed the pack load. The name is now assembled at run time.
This commit is contained in:
1 parent
2889274291
commit
cb9103c4d9
1 file changed
+9
-1
@@ -50,12 +50,20 @@ public final class IrisModuleHost {
|
||||
* Libraries pack modules may call besides the IrisApi, each with its subpackages: VolmLib, which Iris shades unrelocated,
|
||||
* and Gson, which every platform Iris runs on provides.
|
||||
*/
|
||||
public static final List<String> SHARED_LIBRARY_PACKAGES = List.of("art.arcane.volmlib", "com.google.gson");
|
||||
public static final List<String> SHARED_LIBRARY_PACKAGES = List.of("art.arcane.volmlib", platformGsonPackage());
|
||||
/**
|
||||
* The structure file transactions Iris's datapack ingest and the jigsaw module's tools both run, which each would
|
||||
* otherwise see as a copy of its own; exposed with its subpackages.
|
||||
*/
|
||||
public static final String STRUCTURE_FILES_PACKAGE = "art.arcane.iris.core.structure.authoring";
|
||||
/**
|
||||
* Assembled at run time: the Bukkit jar relocates Iris's own Gson, and that relocation rewrites every string constant
|
||||
* naming the package, which would expose Iris's copy instead of the platform's.
|
||||
*/
|
||||
private static String platformGsonPackage() {
|
||||
return String.join(".", "com", "google", "gson");
|
||||
}
|
||||
|
||||
/** Every package pack modules may use besides the IrisApi. {@code exposedHostPackages} in IrisModule's build lists the same. */
|
||||
public static final List<String> EXPOSED_PACKAGES = Stream.concat(Stream.of(BUILT_IN_API_PACKAGE, STRUCTURE_FILES_PACKAGE),
|
||||
SHARED_LIBRARY_PACKAGES.stream()).toList();
|
||||
|
||||
Reference in new issue
Block a user