Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-20 09:50:06 +01:00
Avoid premature trimming in RegionIntersection (#2471)
avoid premature trimming
Dieser Commit ist enthalten in:
Ursprung
6dfa7d1732
Commit
9fff77c088
@ -164,15 +164,24 @@ public class RegionIntersection extends AbstractRegion {
|
|||||||
int bz = chunk.getZ() << 4;
|
int bz = chunk.getZ() << 4;
|
||||||
int tx = bx + 15;
|
int tx = bx + 15;
|
||||||
int tz = bz + 15;
|
int tz = bz + 15;
|
||||||
|
List<Region> intersecting = new ArrayList<>(2);
|
||||||
for (Region region : regions) {
|
for (Region region : regions) {
|
||||||
BlockVector3 regMin = region.getMinimumPoint();
|
BlockVector3 regMin = region.getMinimumPoint();
|
||||||
BlockVector3 regMax = region.getMaximumPoint();
|
BlockVector3 regMax = region.getMaximumPoint();
|
||||||
if (tx >= regMin.getX() && bx <= regMax.getX() && tz >= regMin.getZ() && bz <= regMax.getZ()) {
|
if (tx >= regMin.getX() && bx <= regMax.getX() && tz >= regMin.getZ() && bz <= regMax.getZ()) {
|
||||||
return region.processSet(chunk, get, set);
|
intersecting.add(region);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (intersecting.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (intersecting.size() == 1) {
|
||||||
|
return intersecting.get(0).processSet(chunk, get, set);
|
||||||
|
}
|
||||||
|
// if multiple regions intersect with this chunk, we must be more careful, otherwise one region might trim content of
|
||||||
|
// another region
|
||||||
|
return super.processSet(chunk, get, set);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Future<?> postProcessSet(final IChunk chunk, final IChunkGet get, final IChunkSet set) {
|
public Future<?> postProcessSet(final IChunk chunk, final IChunkGet get, final IChunkSet set) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren