mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-02 16:07:06 +00:00
add setting to enable changing to the vanilla dimension height values
This commit is contained in:
parent
686ae57b5b
commit
94bf530d93
@ -181,6 +181,7 @@ public class IrisSettings {
|
|||||||
public boolean splashLogoStartup = true;
|
public boolean splashLogoStartup = true;
|
||||||
public boolean useConsoleCustomColors = true;
|
public boolean useConsoleCustomColors = true;
|
||||||
public boolean useCustomColorsIngame = true;
|
public boolean useCustomColorsIngame = true;
|
||||||
|
public boolean adjustVanillaHeight = false;
|
||||||
public String forceMainWorld = "";
|
public String forceMainWorld = "";
|
||||||
public int spinh = -20;
|
public int spinh = -20;
|
||||||
public int spins = 7;
|
public int spins = 7;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
package com.volmit.iris.engine.object;
|
package com.volmit.iris.engine.object;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.core.ServerConfigurator.DimensionHeight;
|
import com.volmit.iris.core.ServerConfigurator.DimensionHeight;
|
||||||
import com.volmit.iris.core.loader.IrisData;
|
import com.volmit.iris.core.loader.IrisData;
|
||||||
import com.volmit.iris.core.loader.IrisRegistrant;
|
import com.volmit.iris.core.loader.IrisRegistrant;
|
||||||
@ -409,9 +410,6 @@ public class IrisDimension extends IrisRegistrant {
|
|||||||
Iris.verbose(" Installing Data Pack Dimension Types: \"iris:overworld\", \"iris:the_nether\", \"iris:the_end\"");
|
Iris.verbose(" Installing Data Pack Dimension Types: \"iris:overworld\", \"iris:the_nether\", \"iris:the_end\"");
|
||||||
changed = writeDimensionType(changed, datapacks, height);
|
changed = writeDimensionType(changed, datapacks, height);
|
||||||
|
|
||||||
Iris.verbose(" Installing Data Pack World Preset: \"minecraft:iris\"");
|
|
||||||
changed = writeWorldPreset(changed, datapacks, fixer);
|
|
||||||
|
|
||||||
if (write) {
|
if (write) {
|
||||||
File mcm = new File(datapacks, "iris/pack.mcmeta");
|
File mcm = new File(datapacks, "iris/pack.mcmeta");
|
||||||
try {
|
try {
|
||||||
@ -449,55 +447,38 @@ public class IrisDimension extends IrisRegistrant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean writeDimensionType(boolean changed, File datapacks, DimensionHeight height) {
|
public boolean writeDimensionType(boolean changed, File datapacks, DimensionHeight height) {
|
||||||
File dimTypeOverworld = new File(datapacks, "iris/data/iris/dimension_type/overworld.json");
|
changed = write(changed, datapacks, "overworld", height.overworldType());
|
||||||
if (!dimTypeOverworld.exists())
|
changed = write(changed, datapacks, "the_nether", height.netherType());
|
||||||
changed = true;
|
changed = write(changed, datapacks, "the_end", height.endType());
|
||||||
dimTypeOverworld.getParentFile().mkdirs();
|
|
||||||
try {
|
|
||||||
IO.writeAll(dimTypeOverworld, height.overworldType());
|
|
||||||
} catch (IOException e) {
|
|
||||||
Iris.reportError(e);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
File dimTypeNether = new File(datapacks, "iris/data/iris/dimension_type/the_nether.json");
|
|
||||||
if (!dimTypeNether.exists())
|
|
||||||
changed = true;
|
|
||||||
dimTypeNether.getParentFile().mkdirs();
|
|
||||||
try {
|
|
||||||
IO.writeAll(dimTypeNether, height.netherType());
|
|
||||||
} catch (IOException e) {
|
|
||||||
Iris.reportError(e);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
File dimTypeEnd = new File(datapacks, "iris/data/iris/dimension_type/the_end.json");
|
|
||||||
if (!dimTypeEnd.exists())
|
|
||||||
changed = true;
|
|
||||||
dimTypeEnd.getParentFile().mkdirs();
|
|
||||||
try {
|
|
||||||
IO.writeAll(dimTypeEnd, height.endType());
|
|
||||||
} catch (IOException e) {
|
|
||||||
Iris.reportError(e);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean writeWorldPreset(boolean changed, File datapacks, IDataFixer fixer) {
|
private static boolean write(boolean changed, File datapacks, String type, String json) {
|
||||||
File worldPreset = new File(datapacks, "iris/data/minecraft/worldgen/world_preset/iris.json");
|
File dimType = new File(datapacks, "iris/data/iris/dimension_type/" + type + ".json");
|
||||||
if (!worldPreset.exists())
|
if (!dimType.exists())
|
||||||
changed = true;
|
changed = true;
|
||||||
|
dimType.getParentFile().mkdirs();
|
||||||
try {
|
try {
|
||||||
IO.writeAll(worldPreset, fixer.createPreset());
|
IO.writeAll(dimType, json);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Iris.reportError(e);
|
Iris.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IrisSettings.get().getGeneral().adjustVanillaHeight) {
|
||||||
|
File dimTypeVanilla = new File(datapacks, "iris/data/minecraft/dimension_type/" + type + ".json");
|
||||||
|
if (!dimTypeVanilla.exists())
|
||||||
|
changed = true;
|
||||||
|
dimTypeVanilla.getParentFile().mkdirs();
|
||||||
|
try {
|
||||||
|
IO.writeAll(dimTypeVanilla, json);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Iris.reportError(e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user