Fix block positions not wrapping around correctly

This commit is contained in:
James Seibel
2021-06-23 19:31:41 -05:00
parent 2711fbf01a
commit 8390cfc6fb
@@ -56,8 +56,15 @@ public class LodServerWorld implements ISeedReader {
@Override
public int getHeight(Type heightmapType, int x, int z) {
return chunk.getHeightmap(Type.WORLD_SURFACE_WG).getHeight(Math.abs(x % LodChunk.WIDTH), Math.abs(z % LodChunk.WIDTH));
public int getHeight(Type heightmapType, int x, int z)
{
x = x % LodChunk.WIDTH;
x = (x < 0) ? x + 16 : x;
z = z % LodChunk.WIDTH;
z = (z < 0) ? z + 16 : z;
return chunk.getHeightmap(Type.WORLD_SURFACE_WG).getHeight(x, z);
}
@Override