Skip to content

Commit 49b063a

Browse files
authored
fix: compound tags can be nullable when converting state to baseblock (#2914)
1 parent f820cb2 commit 49b063a

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/block/CharFilterBlock.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,7 @@ public final BaseBlock getFullBlock() {
263263
final BlockMaterial material = state.getMaterial();
264264
if (material.hasContainer()) {
265265
final FaweCompoundTag tag = get.tile(x, y + yy, z);
266-
assert tag != null : "has container but is null";
267-
return state.toBaseBlock(tag.linTag());
266+
return state.toBaseBlock(tag == null ? null : tag.linTag());
268267
}
269268
return state.toBaseBlock();
270269
}

worldedit-core/src/main/java/com/fastasyncworldedit/core/world/block/CompoundInput.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ public BaseBlock get(BlockState state, ITileInput input, int x, int y, int z) {
1717
@Override
1818
public BaseBlock get(final BlockState state, final IBlocks blocks, final int x, final int y, final int z) {
1919
final FaweCompoundTag tile = blocks.tile(x, y, z);
20-
assert tile != null : "container without tile entity";
21-
return state.toBaseBlock(tile.linTag());
20+
return state.toBaseBlock(tile == null ? null : tile.linTag());
2221
}
2322
};
2423

worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ public <T extends BlockStateHolder<T>> boolean setBlock(
427427

428428
@Override
429429
public boolean tile(int x, int y, int z, FaweCompoundTag tile) throws WorldEditException {
430-
return setBlock(x, y, z, getBlock(x, y, z).toBaseBlock(tile.linTag()));
430+
return setBlock(x, y, z, getBlock(x, y, z).toBaseBlock(tile == null ? null : tile.linTag()));
431431
}
432432
//FAWE end
433433

0 commit comments

Comments
 (0)