Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-20 01:40:06 +01:00
Avoid premature trimming in RegionIntersection (#2471)
avoid premature trimming
Dieser Commit ist enthalten in:
Ursprung
6dfa7d1732
Commit
9fff77c088
@ -164,14 +164,23 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
if (intersecting.isEmpty()) {
|
||||||
|
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
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren