Skip to content

Commit

Permalink
fix: compound tags can be nullable when converting state to baseblock (
Browse files Browse the repository at this point in the history
  • Loading branch information
dordsor21 authored Sep 15, 2024
1 parent f820cb2 commit 49b063a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ public final BaseBlock getFullBlock() {
final BlockMaterial material = state.getMaterial();
if (material.hasContainer()) {
final FaweCompoundTag tag = get.tile(x, y + yy, z);
assert tag != null : "has container but is null";
return state.toBaseBlock(tag.linTag());
return state.toBaseBlock(tag == null ? null : tag.linTag());
}
return state.toBaseBlock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public BaseBlock get(BlockState state, ITileInput input, int x, int y, int z) {
@Override
public BaseBlock get(final BlockState state, final IBlocks blocks, final int x, final int y, final int z) {
final FaweCompoundTag tile = blocks.tile(x, y, z);
assert tile != null : "container without tile entity";
return state.toBaseBlock(tile.linTag());
return state.toBaseBlock(tile == null ? null : tile.linTag());
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public <T extends BlockStateHolder<T>> boolean setBlock(

@Override
public boolean tile(int x, int y, int z, FaweCompoundTag tile) throws WorldEditException {
return setBlock(x, y, z, getBlock(x, y, z).toBaseBlock(tile.linTag()));
return setBlock(x, y, z, getBlock(x, y, z).toBaseBlock(tile == null ? null : tile.linTag()));
}
//FAWE end

Expand Down

0 comments on commit 49b063a

Please sign in to comment.