[1.15.x] Add horizon hook (#7528)

* Redirect getHorizonHeight to extension interface

* Add getHorizonHeight method
This commit is contained in:
Joseph Tarbit authored and GitHub committed 2021-03-22 12:32:20 +10:30
1 parent 52dd0eceb2
commit 90ced4b3f7
2 files changed
+15 -2

No files matched your search

@@ -69,3 +69,12 @@
if (p_217384_1_ == this.field_73037_M.field_71439_g) {
this.field_73037_M.func_147118_V().func_147682_a(new EntityTickableSound(p_217384_3_, p_217384_4_, p_217384_2_));
}
@@ -689,7 +706,7 @@
}
public double func_228331_m_() {
- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c ? 0.0D : 63.0D;
+ return this.field_73011_w.getHorizonHeight();
}
public int func_228332_n_() {
@@ -26,9 +26,8 @@ import net.minecraft.client.renderer.Vector3f;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.dimension.Dimension;
@@ -239,6 +238,11 @@ public interface IForgeDimension
return 63;
}
default double getHorizonHeight()
{
return getWorld().getWorldInfo().getGenerator() == WorldType.FLAT ? 0.0D : 63.0D;
}
/**
* Determine if the cursor on the map should 'spin' when rendered, like it does for the player in the nether.
*