Skip to content

Commit

Permalink
prevent bleeding
Browse files Browse the repository at this point in the history
  • Loading branch information
boy0001 committed Dec 26, 2017
1 parent 395b46c commit 1cb4cb3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ public void build(EditSession editSession, Vector position, Pattern pattern, dou
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) {
int zz = bz + z;
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;

Expand Down

0 comments on commit 1cb4cb3

Please sign in to comment.