mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-28 10:36:43 -05:00
82b1bb3ec3
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. |
||
---|---|---|
.. | ||
main | ||
testmod | ||
testmodClient/java/net/fabricmc/fabric/test/lookup/client |