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

This commit is contained in:
Xerousso 2020-08-04 03:21:13 +04:00 committed by GitHub
parent 399bc6c9c3
commit 97a2b9a448
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -36,7 +36,7 @@
return true; return true;
} }
} }
@@ -589,6 +589,17 @@ @@ -589,6 +589,22 @@
} }
} }
@ -50,6 +50,11 @@
+ public Biome getHill(net.minecraft.world.gen.INoiseRandom rand) { + public Biome getHill(net.minecraft.world.gen.INoiseRandom rand) {
+ return null; + 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 { public static class Builder {
@Nullable @Nullable

View file

@ -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;