prevent bleeding

This commit is contained in:
Jesse Boyd 2017-12-26 22:58:36 +11:00
parent 395b46c842
commit 1cb4cb345f
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
1 changed files with 5 additions and 5 deletions

View File

@ -91,10 +91,10 @@ public class HeightBrush implements Brush {
int minIndex = -(size * 2) - 1;
int width = hmmg.getWidth();
int minX = Math.max(-size, origin.getBlockX() - bx);
int minZ = Math.max(-size, origin.getBlockZ() - bz);
int maxX = Math.min(size, origin.getBlockX() + hmmg.getWidth() - 1 - bx);
int maxZ = Math.min(size, origin.getBlockZ() + hmmg.getLength() - 1 - bz);
int minX = Math.max(-size, -bx);
int minZ = Math.max(-size, -bz);
int maxX = Math.min(size, hmmg.getWidth() - 1 - bx);
int maxZ = Math.min(size, hmmg.getLength() - 1 - bz);
int zIndex = (bz + minZ) * width;
for (int z = minZ; z <= maxZ; z++, zIndex += width) {
@ -102,7 +102,7 @@ public class HeightBrush implements Brush {
int index = zIndex + (bx + minX);
if (index < minIndex) continue;
if (index >= metaHeight.length) break;
for (int x = maxX; x <= maxX; x++, index++) {
for (int x = minX; x <= maxX; x++, index++) {
if (index < 0) continue;
if (index >= metaHeight.length) break;