fabric/fabric-api-lookup-api-v1/src
Jonathan Coates 82b1bb3ec3
Check for the correct BE type in the lookup API (#3510)
The block lookup API's registerForBlockEntities method currently just
registers the passed provider for each valid block for that block
entity.

However, in some situations (such as update suppression or a misbehaving
mod), the wrong block entity will be present for one of these blocks.
This means that the (incorrect) block entity will be passed off to the
provider. Providers (especially those registered with
registerForBlockEntity) will often blind-cast the supplied BE, leading
to crashes.

While the wrong BE being present is a bug, we should follow vanilla's
lead and handle this more gracefully. In this case, we just check
whether the correct BE type is present before forwarding it to the
main provider.
2024-01-11 15:44:32 +00:00
..
main Check for the correct BE type in the lookup API (#3510) 2024-01-11 15:44:32 +00:00
testmod Configure spotless for imports, sort imports. (#3365) 2023-10-22 13:35:58 +01:00
testmodClient/java/net/fabricmc/fabric/test/lookup/client Split test mods into client and common. (#3033) 2023-05-01 14:04:29 +01:00