Separate options for dimensions
This commit is contained in:
parent
384fe3a327
commit
7dd8554aff
2 changed files with 27 additions and 17 deletions
|
@ -8,7 +8,7 @@ import ru.bclib.world.generator.GeneratorOptions;
|
||||||
|
|
||||||
public final class BCLibPatch {
|
public final class BCLibPatch {
|
||||||
public static void register(){
|
public static void register(){
|
||||||
if (GeneratorOptions.fixBiomeSource()) {
|
if (GeneratorOptions.fixEndBiomeSource() || GeneratorOptions.fixNetherBiomeSource()) {
|
||||||
DataFixerAPI.registerPatch(BiomeSourcePatch::new);
|
DataFixerAPI.registerPatch(BiomeSourcePatch::new);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ final class BiomeSourcePatch extends ForcedLevelPatch{
|
||||||
long seed = worldGenSettings.getLong("seed");
|
long seed = worldGenSettings.getLong("seed");
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
||||||
|
if (GeneratorOptions.fixNetherBiomeSource()) {
|
||||||
if (!dimensions.contains("minecraft:the_nether") || !isBCLibEntry(dimensions.getCompound("minecraft:the_nether"))) {
|
if (!dimensions.contains("minecraft:the_nether") || !isBCLibEntry(dimensions.getCompound("minecraft:the_nether"))) {
|
||||||
CompoundTag dimRoot = new CompoundTag();
|
CompoundTag dimRoot = new CompoundTag();
|
||||||
dimRoot.put("generator", makeNetherGenerator(seed));
|
dimRoot.put("generator", makeNetherGenerator(seed));
|
||||||
|
@ -36,7 +37,9 @@ final class BiomeSourcePatch extends ForcedLevelPatch{
|
||||||
dimensions.put("minecraft:the_nether", dimRoot);
|
dimensions.put("minecraft:the_nether", dimRoot);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GeneratorOptions.fixEndBiomeSource()) {
|
||||||
if (!dimensions.contains("minecraft:the_end") || !isBCLibEntry(dimensions.getCompound("minecraft:the_end"))) {
|
if (!dimensions.contains("minecraft:the_end") || !isBCLibEntry(dimensions.getCompound("minecraft:the_end"))) {
|
||||||
CompoundTag dimRoot = new CompoundTag();
|
CompoundTag dimRoot = new CompoundTag();
|
||||||
dimRoot.put("generator", makeEndGenerator(seed));
|
dimRoot.put("generator", makeEndGenerator(seed));
|
||||||
|
@ -44,6 +47,7 @@ final class BiomeSourcePatch extends ForcedLevelPatch{
|
||||||
dimensions.put("minecraft:the_end", dimRoot);
|
dimensions.put("minecraft:the_end", dimRoot);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,8 @@ public class GeneratorOptions {
|
||||||
private static boolean useOldBiomeGenerator = false;
|
private static boolean useOldBiomeGenerator = false;
|
||||||
private static boolean verticalBiomes = true;
|
private static boolean verticalBiomes = true;
|
||||||
private static long farEndBiomesSqr = 1000000;
|
private static long farEndBiomesSqr = 1000000;
|
||||||
private static boolean fixBiomeSource = true;
|
private static boolean fixEndBiomeSource = true;
|
||||||
|
private static boolean fixNetherBiomeSource = true;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
biomeSizeNether = Configs.GENERATOR_CONFIG.getInt("nether.biomeMap", "biomeSize", 256);
|
biomeSizeNether = Configs.GENERATOR_CONFIG.getInt("nether.biomeMap", "biomeSize", 256);
|
||||||
|
@ -32,7 +33,8 @@ public class GeneratorOptions {
|
||||||
addEndBiomesByCategory = Configs.GENERATOR_CONFIG.getBoolean("options", "addEndBiomesByCategory", false);
|
addEndBiomesByCategory = Configs.GENERATOR_CONFIG.getBoolean("options", "addEndBiomesByCategory", false);
|
||||||
useOldBiomeGenerator = Configs.GENERATOR_CONFIG.useOldGenerator();
|
useOldBiomeGenerator = Configs.GENERATOR_CONFIG.useOldGenerator();
|
||||||
verticalBiomes = Configs.GENERATOR_CONFIG.getBoolean("options", "verticalBiomesInTallNether", true);
|
verticalBiomes = Configs.GENERATOR_CONFIG.getBoolean("options", "verticalBiomesInTallNether", true);
|
||||||
fixBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options", "fixBiomeSource", true);
|
fixEndBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options.biomeSource", "fixEndBiomeSource", true);
|
||||||
|
fixNetherBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options.biomeSource", "fixNetherBiomeSource", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getBiomeSizeNether() {
|
public static int getBiomeSizeNether() {
|
||||||
|
@ -103,7 +105,11 @@ public class GeneratorOptions {
|
||||||
return verticalBiomes;
|
return verticalBiomes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean fixBiomeSource() {
|
public static boolean fixEndBiomeSource() {
|
||||||
return fixBiomeSource;
|
return fixEndBiomeSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean fixNetherBiomeSource() {
|
||||||
|
return fixNetherBiomeSource;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue