9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-19 15:09:18 +00:00

return if missing datapack entries were found

This commit is contained in:
Julian Krings
2025-09-17 17:36:18 +02:00
parent 3095a92522
commit 00997c1902

View File

@@ -103,14 +103,14 @@ public class ServerConfigurator {
return worlds; return worlds;
} }
public static void installDataPacks(boolean fullInstall) { public static boolean installDataPacks(boolean fullInstall) {
installDataPacks(DataVersion.getDefault(), fullInstall); return installDataPacks(DataVersion.getDefault(), fullInstall);
} }
public static void installDataPacks(IDataFixer fixer, boolean fullInstall) { public static boolean installDataPacks(IDataFixer fixer, boolean fullInstall) {
if (fixer == null) { if (fixer == null) {
Iris.error("Unable to install datapacks, fixer is null!"); Iris.error("Unable to install datapacks, fixer is null!");
return; return false;
} }
Iris.info("Checking Data Packs..."); Iris.info("Checking Data Packs...");
DimensionHeight height = new DimensionHeight(fixer); DimensionHeight height = new DimensionHeight(fixer);
@@ -129,11 +129,10 @@ public class ServerConfigurator {
IrisDimension.writeShared(folders, height); IrisDimension.writeShared(folders, height);
Iris.info("Data Packs Setup!"); Iris.info("Data Packs Setup!");
if (fullInstall) return fullInstall && verifyDataPacksPost(IrisSettings.get().getAutoConfiguration().isAutoRestartOnCustomBiomeInstall());
verifyDataPacksPost(IrisSettings.get().getAutoConfiguration().isAutoRestartOnCustomBiomeInstall());
} }
private static void verifyDataPacksPost(boolean allowRestarting) { private static boolean verifyDataPacksPost(boolean allowRestarting) {
try (Stream<IrisData> stream = allPacks()) { try (Stream<IrisData> stream = allPacks()) {
boolean bad = stream boolean bad = stream
.map(data -> { .map(data -> {
@@ -148,7 +147,7 @@ public class ServerConfigurator {
}) })
.toList() .toList()
.contains(true); .contains(true);
if (!bad) return; if (!bad) return false;
} }
@@ -172,6 +171,7 @@ public class ServerConfigurator {
J.sleep(3000); J.sleep(3000);
} }
return true;
} }
public static void restart() { public static void restart() {