Skip to content

Commit 61f4a48

Browse files
authored
Fix mutability issue leading to wrong behavior in //ascend and //descend (#3101)
1 parent 6a8ea4c commit 61f4a48

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,8 @@ public boolean ascendLevel() {
280280
int yPlusSearchHeight = y + WorldEdit.getInstance().getConfiguration().defaultVerticalHeight;
281281
int maxY = Math.min(world.getMaxY(), yPlusSearchHeight) + 2;
282282

283-
//FAWE start - mutable
284-
MutableBlockVector3 mutable = new MutableBlockVector3(x, y, z);
285-
//FAWE end
286-
287283
while (y <= maxY) {
288-
//FAWE start - mutable
289-
if (isLocationGoodForStanding(mutable.mutY(y))
290-
//FAWE end
284+
if (isLocationGoodForStanding(BlockVector3.at(x, y, z))
291285
&& trySetPosition(Vector3.at(x + 0.5, y, z + 0.5))) {
292286
return true;
293287
}
@@ -308,14 +302,8 @@ public boolean descendLevel() {
308302
int yLessSearchHeight = y - WorldEdit.getInstance().getConfiguration().defaultVerticalHeight;
309303
int minY = Math.min(world.getMinY() + 1, yLessSearchHeight);
310304

311-
//FAWE start - mutable
312-
MutableBlockVector3 mutable = new MutableBlockVector3(x, y, z);
313-
//FAWE end
314-
315305
while (y >= minY) {
316-
//FAWE start - mutable
317-
if (isLocationGoodForStanding(mutable.mutY(y))
318-
//FAWE end
306+
if (isLocationGoodForStanding(BlockVector3.at(x, y, z))
319307
&& trySetPosition(Vector3.at(x + 0.5, y, z + 0.5))) {
320308
return true;
321309
}

0 commit comments

Comments
 (0)