mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Drop the legacy handling of a pack's own iris-builtins.jar
Nothing is released, so packs get no compatibility path: a pack that still holds its own iris-builtins.jar fails to load naming both jars (IrisApi), instead of being skipped with a warning. The missing built-ins warning no longer suggests copying the jar into a pack, which would now collide with the bundled one; it says to build the plugin.
This commit is contained in:
1 parent
72c3d662c1
commit
bc7f9127b5
4 files changed
+4
-15
No files matched your search
@@ -45,6 +45,6 @@ final class MissingBuiltInModules {
|
||||
return Optional.of("Pack " + packFolder.getName() + " loads without the built-in modules (" + JAR_NAME + "): its world gets"
|
||||
+ " only its layout (biomes and heights), with no terrain blocks, ores, caves, decorations, objects or vanilla features,"
|
||||
+ " and no loot, block drops, entity spawns or ambient effects. This build of Iris does not bundle " + JAR_NAME
|
||||
+ "; use a complete build, or copy the jar into " + new File(packFolder, PackModuleSet.MODULES_FOLDER).getPath() + ".");
|
||||
+ "; build the plugin with ./gradlew iris.");
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,6 @@ public final class PackModuleSet implements AutoCloseable {
|
||||
static final String MODULES_FOLDER = "modules";
|
||||
private static final String JAR_EXTENSION = ".jar";
|
||||
private static final String MISSING_BUILT_INS_KEY = "missing-built-in-modules:";
|
||||
private static final String REPLACED_JAR_KEY = "replaced-module-jar:";
|
||||
|
||||
private final File packFolder;
|
||||
private final Supplier<Gson> irisGson;
|
||||
@@ -125,7 +124,6 @@ public final class PackModuleSet implements AutoCloseable {
|
||||
pack = loaded;
|
||||
state = State.LOADED;
|
||||
warnWhenBuiltInModulesAreMissing(loaded);
|
||||
warnAboutReplacedJars(loaded);
|
||||
} catch (RuntimeException loadFailure) {
|
||||
failure = new PackModulesException(packFolder, loadFailure);
|
||||
state = State.FAILED;
|
||||
@@ -139,14 +137,6 @@ public final class PackModuleSet implements AutoCloseable {
|
||||
.ifPresent(warning -> IrisLogging.warnOnce(MISSING_BUILT_INS_KEY + packFolder.getAbsolutePath(), "%s", warning));
|
||||
}
|
||||
|
||||
/** A pack's own copy of a jar Iris bundles, such as an old {@code iris-builtins.jar}, is left out; its owner is told once. */
|
||||
private void warnAboutReplacedJars(LoadedPack loaded) {
|
||||
for (String jar : loaded.replacedJars()) {
|
||||
String path = new File(packFolder, jar).getAbsolutePath();
|
||||
IrisLogging.warnOnce(REPLACED_JAR_KEY + path, "%s is not loaded; Iris's own copy loads instead. Delete it.", path);
|
||||
}
|
||||
}
|
||||
|
||||
/** Each module jar's name, size and modification time, in name order. */
|
||||
private List<String> jarFingerprint() {
|
||||
File[] jars = new File(packFolder, MODULES_FOLDER).listFiles(file -> file.isFile() && file.getName().endsWith(JAR_EXTENSION));
|
||||
|
||||
@@ -35,12 +35,11 @@ public class MissingBuiltInModulesTest {
|
||||
private static final File PACK = new File("packs", "overworld");
|
||||
|
||||
@Test
|
||||
public void aPackWithNoModulesIsToldWhichJarToCopyWhere() {
|
||||
public void aPackWithNoModulesIsToldHowToGetThem() {
|
||||
String warning = MissingBuiltInModules.warning(PACK, List.of()).orElseThrow();
|
||||
|
||||
assertTrue(warning, warning.startsWith("Pack overworld loads without the built-in modules (iris-builtins.jar)"));
|
||||
assertTrue(warning, warning.contains("does not bundle iris-builtins.jar; use a complete build, or copy the jar into "
|
||||
+ new File(PACK, "modules").getPath() + "."));
|
||||
assertTrue(warning, warning.endsWith("does not bundle iris-builtins.jar; build the plugin with ./gradlew iris."));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -74,7 +74,7 @@ public class PackModuleSetTest {
|
||||
String warnings = warningsWhile(() -> new PackModuleSet(pack, Gson::new).pack());
|
||||
|
||||
assertTrue(warnings, warnings.contains("[Iris/WARN] Pack without-builtins loads without the built-in modules (iris-builtins.jar)"));
|
||||
assertTrue(warnings, warnings.contains("copy the jar into " + new File(pack, "modules").getPath()));
|
||||
assertTrue(warnings, warnings.contains("build the plugin with ./gradlew iris."));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user