9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-25 01:59:15 +00:00

Refactor.

This commit is contained in:
Vatuu
2022-05-15 20:28:11 +02:00
parent 8951fcdebd
commit d133ac0088

View File

@@ -407,18 +407,8 @@ public class IrisDimension extends IrisRegistrant {
}
if(!dimensionHeight.equals(new IrisRange(-64, 320)) && this.name.equalsIgnoreCase("overworld")) {
File dimType = new File(datapacks, "iris/data/minecraft/dimension_type/overworld.json");
if(!dimType.exists())
changed = true;
Iris.verbose(" Installing Data Pack Dimension Type: " + dimType.getPath());
dimType.getParentFile().mkdirs();
try {
IO.writeAll(dimType, generateDatapackJson());
} catch(IOException e) {
Iris.reportError(e);
e.printStackTrace();
}
Iris.verbose(" Installing Data Pack Dimension Type: \"minecraft:overworld\"");
changed = writeDimensionType(changed, datapacks);
}
if(write) {
@@ -457,6 +447,20 @@ public class IrisDimension extends IrisRegistrant {
}
public boolean writeDimensionType(boolean changed, File datapacks) {
File dimType = new File(datapacks, "iris/data/minecraft/dimension_type/overworld.json");
if(!dimType.exists())
changed = true;
dimType.getParentFile().mkdirs();
try {
IO.writeAll(dimType, generateDatapackJson());
} catch(IOException e) {
Iris.reportError(e);
e.printStackTrace();
}
return changed;
}
private String generateDatapackJson() {
JSONObject obj = new JSONObject(DP_OVERWORLD_DEFAULT);
obj.put("min_y", dimensionHeight.getMin());