Prevent pseudomultiblocks disappearing on chunk boundaries

If this was indeed a problem, it must've been one before my PR... I suspect maybe some of my intermediate implementations allowed this to have an effect. Regardless, this is definitely a useful fix
This commit is contained in:
abel1502 2025-06-30 00:24:55 +03:00
parent d1497abd1e
commit 18a310ba3a
No known key found for this signature in database
GPG Key ID: 076926596A536338

View File

@ -103,7 +103,12 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
ForgeDirection dir = ForgeDirection.getOrientation(metadata).getOpposite();
Block b = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
if(b != this) {
// An extra precaution against multiblocks on chunk borders being erroneously deleted.
// Technically, this might be used to persist ghost dummy blocks by manipulating
// loaded chunks and block destruction, but this gives no benefit to the player,
// cannot be done accidentally, and is definitely preferable to multiblocks
// just vanishing when their chunks are unloaded in an unlucky way.
if(b != this && world.checkChunksExist(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1)) {
if (isLegacyMonoblock(world, x, y, z)) {
fixLegacyMonoblock(world, x, y, z);
} else {