Fix angle mask

This commit is contained in:
Jesse Boyd 2017-08-04 15:11:11 +10:00
parent 3d2f939377
commit d77ae61894
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -54,14 +54,14 @@ public class AngleMask extends SolidBlockMask implements ResettableMask {
public int getHeight(int x, int y, int z) { public int getHeight(int x, int y, int z) {
try { try {
int rx = x - cacheBotX; int rx = x - cacheBotX + 16;
int rz = z - cacheBotZ; int rz = z - cacheBotZ + 16;
int index; int index;
if (((rx + 16) & 0xFF) != rx + 16 || ((rz + 16) & 0xFF) != rz + 16) { if (((rx & 0xFF) != rx || (rz & 0xFF) != rz)) {
cacheBotX = x - 16; cacheBotX = x - 16;
cacheBotZ = z - 16; cacheBotZ = z - 16;
rx = x - cacheBotX; rx = x - cacheBotX + 16;
rz = z - cacheBotZ; rz = z - cacheBotZ + 16;
index = rx + (rz << 8); index = rx + (rz << 8);
if (cacheHeights == null) { if (cacheHeights == null) {
cacheHeights = new byte[65536]; cacheHeights = new byte[65536];