mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Refactor.
This commit is contained in:
parent
8951fcdebd
commit
d133ac0088
@ -407,18 +407,8 @@ public class IrisDimension extends IrisRegistrant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!dimensionHeight.equals(new IrisRange(-64, 320)) && this.name.equalsIgnoreCase("overworld")) {
|
if(!dimensionHeight.equals(new IrisRange(-64, 320)) && this.name.equalsIgnoreCase("overworld")) {
|
||||||
File dimType = new File(datapacks, "iris/data/minecraft/dimension_type/overworld.json");
|
Iris.verbose(" Installing Data Pack Dimension Type: \"minecraft:overworld\"");
|
||||||
if(!dimType.exists())
|
changed = writeDimensionType(changed, datapacks);
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(write) {
|
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() {
|
private String generateDatapackJson() {
|
||||||
JSONObject obj = new JSONObject(DP_OVERWORLD_DEFAULT);
|
JSONObject obj = new JSONObject(DP_OVERWORLD_DEFAULT);
|
||||||
obj.put("min_y", dimensionHeight.getMin());
|
obj.put("min_y", dimensionHeight.getMin());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user