Fix sea level not being available on client, move hook to Dimension

This commit is contained in:
tterrag 2019-09-23 13:08:26 -04:00
parent dfbd61436b
commit 01a862db30
3 changed files with 18 additions and 5 deletions

View File

@ -453,8 +453,8 @@
public int func_181545_F() {
- return 63;
+ // FORGE: Allow modded dimensions to customize this value via ChunkGenerator
+ return this.field_73020_y.func_201711_g().func_222530_f();
+ // FORGE: Allow modded dimensions to customize this value via Dimension
+ return this.func_201675_m().getSeaLevel();
}
public World func_201672_e() {

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/ChunkGenerator.java
+++ b/net/minecraft/world/gen/ChunkGenerator.java
@@ -195,7 +195,7 @@
public abstract void func_222537_b(IWorld p_222537_1_, IChunk p_222537_2_);
public int func_222530_f() {
- return 63;
+ return field_222540_a.func_201675_m().getSeaLevel();
}
public abstract int func_222529_a(int p_222529_1_, int p_222529_2_, Heightmap.Type p_222529_3_);

View File

@ -22,11 +22,9 @@ package net.minecraftforge.common.extensions;
import javax.annotation.Nullable;
import net.minecraft.client.audio.MusicTicker;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
@ -34,7 +32,6 @@ import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.dimension.Dimension;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.dimension.NetherDimension;
import net.minecraft.world.dimension.OverworldDimension;
import net.minecraft.world.storage.WorldInfo;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -278,6 +275,11 @@ public interface IForgeDimension
{
return getWorld().getWorldInfo().getGenerator().getHorizon(getWorld());
}
default int getSeaLevel()
{
return 63;
}
/**
* Determine if the cursor on the map should 'spin' when rendered, like it does for the player in the nether.