@@ -3298,7 +3298,9 @@ 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+ //FAWE start - mutable
3302+ BlockVector3 neighbor = mutable .setComponents (position ).add (recurseDirection );
3303+ //FAWE end
33023304
33033305 if (outside .contains (neighbor )) {
33043306 newOutside .add (position );
@@ -3313,7 +3315,9 @@ public int hollowOutRegion(Region region, int thickness, Pattern pattern, Mask m
33133315 outer :
33143316 for (BlockVector3 position : region ) {
33153317 for (BlockVector3 recurseDirection : recurseDirections ) {
3316- BlockVector3 neighbor = position .add (recurseDirection );
3318+ //FAWE start - mutable
3319+ BlockVector3 neighbor = mutable .setComponents (position ).add (recurseDirection );
3320+ //FAWE end
33173321
33183322 if (outside .contains (neighbor )) {
33193323 continue outer ;
@@ -3644,10 +3648,12 @@ public Set<BlockVector3> getHollowed(Set<BlockVector3> vset) {
36443648 }
36453649
36463650 private void recurseHollow (Region region , BlockVector3 origin , Set <BlockVector3 > outside , Mask mask ) {
3647- // FAWE start - use BlockVector3Set instead of LinkedList
3651+ // FAWE start - use BlockVector3Set instead of LinkedList & mutable BV3
36483652 final BlockVector3Set queue = BlockVector3Set .getAppropriateVectorSet (region );
36493653 queue .add (origin );
36503654
3655+ MutableBlockVector3 mutable = new MutableBlockVector3 ();
3656+
36513657 while (!queue .isEmpty ()) {
36523658 Iterator <BlockVector3 > iter = queue .iterator ();
36533659 while (iter .hasNext ()) {
@@ -3664,7 +3670,7 @@ private void recurseHollow(Region region, BlockVector3 origin, Set<BlockVector3>
36643670 }
36653671
36663672 for (BlockVector3 recurseDirection : recurseDirections ) {
3667- queue .add (current .add (recurseDirection ));
3673+ queue .add (mutable . setComponents ( current ) .add (recurseDirection ));
36683674 }
36693675 }
36703676 }
0 commit comments