automatically update vanilla dimension type if present in Iris datapack

This commit is contained in:
Julian Krings 2025-03-10 12:09:28 +01:00 committed by Julian Krings
parent 94bf530d93
commit 1c5eb8b910
2 changed files with 4 additions and 2 deletions

View File

@ -107,6 +107,7 @@ public class ServerConfigurator {
DimensionHeight height = new DimensionHeight(fixer);
allPacks().flatMap(height::merge)
.toList()
.forEach(dim -> {
for (File dpack : getDatapacksFolder()) {
Iris.verbose(" Checking Dimension " + dim.getLoadFile().getPath());

View File

@ -456,6 +456,8 @@ public class IrisDimension extends IrisRegistrant {
private static boolean write(boolean changed, File datapacks, String type, String json) {
File dimType = new File(datapacks, "iris/data/iris/dimension_type/" + type + ".json");
File dimTypeVanilla = new File(datapacks, "iris/data/minecraft/dimension_type/" + type + ".json");
if (!dimType.exists())
changed = true;
dimType.getParentFile().mkdirs();
@ -466,8 +468,7 @@ public class IrisDimension extends IrisRegistrant {
e.printStackTrace();
}
if (IrisSettings.get().getGeneral().adjustVanillaHeight) {
File dimTypeVanilla = new File(datapacks, "iris/data/minecraft/dimension_type/" + type + ".json");
if (IrisSettings.get().getGeneral().adjustVanillaHeight || dimTypeVanilla.exists()) {
if (!dimTypeVanilla.exists())
changed = true;
dimTypeVanilla.getParentFile().mkdirs();