Skip to content

Commit

Permalink
Fix mutability issue leading to wrong behavior in //ascend and //desc…
Browse files Browse the repository at this point in the history
…end (#3101)
  • Loading branch information
SirYwell authored Feb 11, 2025
1 parent 6a8ea4c commit 61f4a48
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,8 @@ public boolean ascendLevel() {
int yPlusSearchHeight = y + WorldEdit.getInstance().getConfiguration().defaultVerticalHeight;
int maxY = Math.min(world.getMaxY(), yPlusSearchHeight) + 2;

//FAWE start - mutable
MutableBlockVector3 mutable = new MutableBlockVector3(x, y, z);
//FAWE end

while (y <= maxY) {
//FAWE start - mutable
if (isLocationGoodForStanding(mutable.mutY(y))
//FAWE end
if (isLocationGoodForStanding(BlockVector3.at(x, y, z))
&& trySetPosition(Vector3.at(x + 0.5, y, z + 0.5))) {
return true;
}
Expand All @@ -308,14 +302,8 @@ public boolean descendLevel() {
int yLessSearchHeight = y - WorldEdit.getInstance().getConfiguration().defaultVerticalHeight;
int minY = Math.min(world.getMinY() + 1, yLessSearchHeight);

//FAWE start - mutable
MutableBlockVector3 mutable = new MutableBlockVector3(x, y, z);
//FAWE end

while (y >= minY) {
//FAWE start - mutable
if (isLocationGoodForStanding(mutable.mutY(y))
//FAWE end
if (isLocationGoodForStanding(BlockVector3.at(x, y, z))
&& trySetPosition(Vector3.at(x + 0.5, y, z + 0.5))) {
return true;
}
Expand Down

0 comments on commit 61f4a48

Please sign in to comment.