Added new hook to allow Biomes to control their Edge biomes (#7000)

This commit is contained in:
Xerousso authored and GitHub committed 2020-08-03 16:21:13 -07:00
1 parent 399bc6c9c3
commit 97a2b9a448
2 files changed
+18 -1

No files matched your search

@@ -36,7 +36,7 @@
return true;
}
}
@@ -589,6 +589,17 @@
@@ -589,6 +589,22 @@
}
}
@@ -50,6 +50,11 @@
+ public Biome getHill(net.minecraft.world.gen.INoiseRandom rand) {
+ return null;
+ }
+
+ @Nullable
+ public Biome getEdge(net.minecraft.world.gen.INoiseRandom rand, Biome northBiome, Biome westBiome, Biome southBiome, Biome eastBiome) {
+ return null;
+ }
+
public static class Builder {
@Nullable
@@ -0,0 +1,12 @@
--- a/net/minecraft/world/gen/layer/ShoreLayer.java
+++ b/net/minecraft/world/gen/layer/ShoreLayer.java
@@ -34,6 +34,9 @@
public int func_202748_a(INoiseRandom p_202748_1_, int p_202748_2_, int p_202748_3_, int p_202748_4_, int p_202748_5_, int p_202748_6_) {
Biome biome = Registry.field_212624_m.func_148745_a(p_202748_6_);
+ Biome edgeBiome = biome.getEdge(p_202748_1_, Registry.field_212624_m.func_148745_a(p_202748_2_), Registry.field_212624_m.func_148745_a(p_202748_3_), Registry.field_212624_m.func_148745_a(p_202748_4_), Registry.field_212624_m.func_148745_a(p_202748_5_));
+ if (edgeBiome != null) return Registry.field_212624_m.func_148757_b(edgeBiome);
+
if (p_202748_6_ == field_202784_r) {
if (LayerUtil.func_203631_b(p_202748_2_) || LayerUtil.func_203631_b(p_202748_3_) || LayerUtil.func_203631_b(p_202748_4_) || LayerUtil.func_203631_b(p_202748_5_)) {
return field_202785_s;