Fix client kick when a part is added over a stale convertible block (#62)

This commit is contained in:
Luca authored and GitHub committed 2026-10-04 22:37:34 +02:00
1 parent 9eb69cdc13
commit 290dc4a815
1 file changed
+4 -2
@@ -81,12 +81,14 @@ object MultipartGenerator extends ScratchBitSet {
pos: BlockCoord,
part: TMultiPart
): TileMultipart = {
val (tile, converted) = TileMultipart.getOrConvertTile2(world, pos)
val (tile, converted) =
if (world.isRemote) (TileMultipart.getTile(world, pos), false)
else TileMultipart.getOrConvertTile2(world, pos)
val bitset = setTraits(part, world.isRemote)
var ntile = tile
if (ntile != null) {
if (converted) { // perform client conversion
if (converted) { // server-side conversion, then tell the clients
ntile.partList(0).invalidateConvertedTile()
world.setBlock(pos.x, pos.y, pos.z, MultipartProxy.block, 0, 0)
silentAddTile(world, pos, ntile)