Added hook to allow modded Hill Biomes (#6571)

This commit is contained in:
valoeghese 2020-04-09 12:12:04 +12:00 committed by GitHub
parent c359a38d9f
commit 713c24d916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View File

@ -41,7 +41,7 @@
return true;
}
}
@@ -375,6 +375,12 @@
@@ -375,6 +375,17 @@
return this.field_185364_H;
}
@ -50,11 +50,16 @@
+ if (this == Biomes.field_76789_p || this == Biomes.field_76788_q) return Biomes.field_76788_q;
+ return Biomes.field_76781_i;
+ }
+
+ @Nullable
+ public Biome getHill(net.minecraft.world.gen.INoiseRandom rand) {
+ return null;
+ }
+
public static class Builder {
@Nullable
private ConfiguredSurfaceBuilder<?> field_205422_a;
@@ -526,6 +532,18 @@
@@ -526,6 +537,18 @@
}
}

View File

@ -0,0 +1,14 @@
--- a/net/minecraft/world/gen/layer/HillsLayer.java
+++ b/net/minecraft/world/gen/layer/HillsLayer.java
@@ -59,7 +59,10 @@
if (p_215723_1_.func_202696_a(3) == 0 || k == 0) {
int l = i;
- if (i == field_202799_f) {
+ Biome biome = Registry.field_212624_m.func_148745_a(i);
+ Biome hill = biome == null ? null : biome.getHill(p_215723_1_);
+ if (hill != null) l = Registry.field_212624_m.func_148757_b(hill);
+ else if (i == field_202799_f) {
l = field_202800_g;
} else if (i == field_202803_j) {
l = field_202804_k;