Closed arceste closed 2 years ago
The same issue was reported for CodeChickenLib here: https://github.com/TheCBProject/CodeChickenLib/issues/374 However, this does seem to be a CBMultipart bug, so I will continue using this issue instead.
We did some more investigating and it appears that any Project Red block will cause this bug, even if it's just a lamp. I don't know of any other MultiPart blocks in the Create: Above and Beyond modpack, so we didn't test any others.
To reproduce:
You will not get an IndexOutOfBounds exception. Other tile entities in the same chunk may or may not be affected by this. We assume it has to do with the order in which their data is sent.
As a kind of hotfix, we changed codechicken.multipart.block.TileMultiPart.handleDescPacket
to this, catching the exception and just emitting a warning:
public static void handleDescPacket(World world, BlockPos pos, MCDataInput packet) {
List<TMultiPart> parts = new ArrayList<>();
int nParts;
try {
nParts = packet.readUByte();
} catch (IndexOutOfBoundsException e) {
LogManager.getLogger().warn("Index out of bounds exception for block: {}, {}, {}", pos.getX(), pos.getY(), pos.getZ());
return;
}
for (int i = 0; i < nParts; i++) {
parts.add(MultiPartRegistries.readPart(packet));
}
if (parts.isEmpty()) return;
TileEntity t = world.getBlockEntity(pos);
TileMultiPart tile = MultiPartGenerator.INSTANCE.generateCompositeTile(t, parts, true);
if (tile != t) {
world.setBlockAndUpdate(pos, CBMultipartModContent.blockMultipart.defaultBlockState());
MultiPartHelper.silentAddTile(world, pos, tile);
}
tile.loadParts(parts);
tile.notifyTileChange();
tile.markRender();
}
Presumably, this is not a proper fix for the problem, but it does contain the issue. The Project Red components actually seem to be working normally with this in pace - I assume this is because they constantly send updates and this problem only occurs on first load. Regardless, containing exceptions here might be a good idea for the future, even if a proper fix is implemented.
This issue should be resolved in 3.0.4.123
.
I'm experiencing an issue where certain blocks are invisible until I look directly at them, or in the case of storage drawers, the contents do not appear at all on the front whenever CBMultipart blocks are anywhere nearby. This only occurs in multiplayer, singleplayer solves all woes. A temporary solution was found for this issue in Create: Above and Beyond by force-loading the relevant chunk, though this isn't ideal as a permanent fix. I'm not running Optifine, Magnesium, or anything that isn't in Create: Above and Beyond 1.2 by default.