Skip to content

Commit

Permalink
Fix offset mask mutating vector (#3135)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirYwell authored Mar 6, 2025
1 parent 46dc455 commit c8c6484
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package com.sk89q.worldedit.function.mask;

import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.math.BlockVector3;
Expand Down Expand Up @@ -115,6 +116,10 @@ public void setOffset(BlockVector3 offset) {
@Override
public boolean test(BlockVector3 vector) {
//FAWE start - ignore resultant position outside world height range
if (vector instanceof MutableBlockVector3) {
// make sure we don't modify a vector passed from the outside
vector = vector.toImmutable();
}
BlockVector3 testPos = vector.add(offset);
if (testPos.y() < minY || testPos.y() > maxY) {
return false;
Expand Down

0 comments on commit c8c6484

Please sign in to comment.