Fix regen
This commit is contained in:
parent
bf0903246b
commit
d7f121f8a9
@ -1,6 +1,7 @@
|
||||
package com.boydti.fawe.object.brush;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.IntegerPair;
|
||||
import com.boydti.fawe.object.brush.heightmap.ArrayHeightMap;
|
||||
import com.boydti.fawe.object.brush.heightmap.HeightMap;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
@ -18,6 +19,7 @@ import java.awt.image.BufferedImage;
|
||||
import java.awt.image.Raster;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class HeightBrush implements Brush {
|
||||
@ -41,7 +43,13 @@ public class HeightBrush implements Brush {
|
||||
int minY = clipboard.getMinimumPoint().getBlockY();
|
||||
int maxY = clipboard.getMaximumPoint().getBlockY();
|
||||
int clipHeight = maxY - minY + 1;
|
||||
HashSet<IntegerPair> visited = new HashSet<>();
|
||||
for (Vector pos : clipboard.getRegion()) {
|
||||
IntegerPair pair = new IntegerPair((int) pos.x, (int) pos.z);
|
||||
if (visited.contains(pair)) {
|
||||
continue;
|
||||
}
|
||||
visited.add(pair);
|
||||
int xx = pos.getBlockX();
|
||||
int zz = pos.getBlockZ();
|
||||
int highestY = 0;
|
||||
|
@ -243,11 +243,11 @@ public class WorldWrapper extends AbstractWorld {
|
||||
int bz = cz << 4;
|
||||
Vector cmin = new Vector(bx, 0, bz);
|
||||
Vector cmax = cmin.add(15, getMaxY(), 15);
|
||||
boolean containsBot1 = (fe != null && fe.contains(cmin.getBlockX(), cmin.getBlockY(), cmin.getBlockZ()));
|
||||
boolean containsBot1 = (fe == null || fe.contains(cmin.getBlockX(), cmin.getBlockY(), cmin.getBlockZ()));
|
||||
boolean containsBot2 = region.contains(cmin);
|
||||
boolean containsTop1 = (fe != null && fe.contains(cmax.getBlockX(), cmax.getBlockY(), cmax.getBlockZ()));
|
||||
boolean containsTop1 = (fe == null || fe.contains(cmax.getBlockX(), cmax.getBlockY(), cmax.getBlockZ()));
|
||||
boolean containsTop2 = region.contains(cmax);
|
||||
if (fe == null || (containsBot2 && containsTop2 && !containsBot1 && !containsTop1)) {
|
||||
if ((containsBot2 && containsTop2 && !containsBot1 && !containsTop1)) {
|
||||
return;
|
||||
}
|
||||
if (cuboid && containsBot1 && containsBot2 && containsTop1 && containsTop2) {
|
||||
|
Loading…
Reference in New Issue
Block a user