Skip to content

Commit f2661eb

Browse files
committed
Fix hollowOutRegion mutating vector
Fixes #3083
1 parent c8c6484 commit f2661eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3298,7 +3298,7 @@ public int hollowOutRegion(Region region, int thickness, Pattern pattern, Mask m
32983298
outer:
32993299
for (BlockVector3 position : region) {
33003300
for (BlockVector3 recurseDirection : recurseDirections) {
3301-
BlockVector3 neighbor = position.add(recurseDirection);
3301+
BlockVector3 neighbor = position.toImmutable().add(recurseDirection);
33023302

33033303
if (outside.contains(neighbor)) {
33043304
newOutside.add(position);
@@ -3313,7 +3313,7 @@ public int hollowOutRegion(Region region, int thickness, Pattern pattern, Mask m
33133313
outer:
33143314
for (BlockVector3 position : region) {
33153315
for (BlockVector3 recurseDirection : recurseDirections) {
3316-
BlockVector3 neighbor = position.add(recurseDirection);
3316+
BlockVector3 neighbor = position.toImmutable().add(recurseDirection);
33173317

33183318
if (outside.contains(neighbor)) {
33193319
continue outer;

0 commit comments

Comments
 (0)