Fixed the requested changes for Terrain Movement. Tested and working.

This commit is contained in:
Milutinke 2022-08-18 20:58:49 +02:00
parent 9f197d415e
commit af6f655d5e
7 changed files with 60 additions and 72 deletions

View file

@ -14,7 +14,7 @@ namespace MinecraftClient.Mapping
/// The X Coordinate
/// </summary>
public double X;
/// <summary>
/// The Y Coordinate (vertical)
/// </summary>
@ -25,11 +25,6 @@ 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>
@ -84,10 +79,7 @@ namespace MinecraftClient.Mapping
{
get
{
if (world.GetDimension() == null)
return (int)Math.Floor(Y / Chunk.SizeY); // below 1.16.2, Y coordinate always start from zero
else
return (int)Math.Floor((Y - world.GetDimension().minY) / Chunk.SizeY);
return (int)Math.Floor((Y - World.GetDimension().minY) / Chunk.SizeY);
}
}