Fix strange out of bounds. Mod compatibility issue?

This commit is contained in:
Moulberry committed 2024-11-18 23:26:21 +08:00
1 parent f39d014c99
commit 34a77ffd62
1 file changed
+4
@@ -1009,6 +1009,10 @@ public class ReplayGamePacketHandler implements ClientGamePacketListener {
SynchedEntityData entityData = entity.getEntityData();
for (SynchedEntityData.DataValue<?> dataValue : clientboundSetEntityDataPacket.packedItems()) {
if (dataValue.id() >= entityData.itemsById.length) {
continue;
}
SynchedEntityData.DataItem<?> dataItem = entityData.itemsById[dataValue.id()];
entityData.set((EntityDataAccessor) dataItem.getAccessor(), dataValue.value(), true);
}