Skip to content

Commit 8ca47e6

Browse files
authored
fix: don't return null when slow applyBlock method is called by CoreProtect (#3185)
1 parent 0ceb2d9 commit 8ca47e6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/PlacementStateProcessor.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,16 +506,13 @@ public boolean apply(Extent orDefault, BlockVector3 get, BlockVector3 set) throw
506506

507507
@Override
508508
public BaseBlock applyBlock(BlockVector3 position) {
509-
if (finished.get()) {
510-
return null;
511-
}
512509
BaseBlock block = extent.getFullBlock(position);
513-
if (!mask.test(block)) {
514-
return null;
510+
if (finished.get() || !mask.test(block)) {
511+
return block;
515512
}
516513
if (REQUIRES_SECOND_PASS.test(block) && ADJACENT_STAIR_MASK.test(extent, position)) {
517514
postCompleteSecondPasses.put(new SecondPass(position), (char) 0);
518-
return null;
515+
return block;
519516
}
520517
char newOrdinal = getBlockOrdinal(position.x(), position.y(), position.z(), block.toBlockState());
521518
if (block.getOrdinalChar() != newOrdinal) {
@@ -526,7 +523,7 @@ public BaseBlock applyBlock(BlockVector3 position) {
526523
}
527524
return state.toBaseBlock();
528525
}
529-
return null;
526+
return block;
530527
}
531528

532529
protected record SecondPass(int x, int y, int z, FaweCompoundTag tile) {

0 commit comments

Comments
 (0)