terrain handling for 1.18(1.18.1) and 1.18.2

This commit is contained in:
BruceChen 2022-07-24 21:41:56 +08:00
parent af574b654e
commit 516effa81d
6 changed files with 384 additions and 120 deletions

View file

@ -25,6 +25,11 @@ namespace MinecraftClient.Mapping
/// </summary>
public double Z;
/// <summary>
/// Current world: to get the lowest Y coordinate
/// </summary>
public static World world;
/// <summary>
/// Get location with zeroed coordinates
/// </summary>
@ -79,7 +84,10 @@ namespace MinecraftClient.Mapping
{
get
{
return (int)Math.Floor(Y / Chunk.SizeY);
if (world.GetDimension() == null)
return (int)Math.Floor(Y / Chunk.SizeY); // old version, always start at zero
else
return (int)Math.Floor((Y - world.GetDimension().min_y) / Chunk.SizeY);
}
}