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.
(cherry picked from commit 82b1bb3ec3)
Breaking changes:
- `FabricBrewingRecipeRegistry.registerPotionRecipe` takes `RegistryEntry<Potion>` instead of `Potion`
- `SculkSensorFrequencyRegistry.regster` takes `RegistryKey<GameEvent>` instead of `GameEvent`
- `FabricLanguageProvider.add` takes `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
- `FabricTagProvider.GameEventTagProvider` was removed replace with `FabricTagProvider<GameEvent>`
- `FabricItem.getAttributeModifiers` returns a Multimap with a key of `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
- `ModifyItemAttributeModifiersCallback.modifyAttributeModifiers` takes Multimap with a key of `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
* channeled network addon refactor
* checkstyle
* fix junit tests
* convert TypedPayload <-> UntypedPayload if necessary
* assert payload size
* add vm arg to force serialization
* change log level to info and make it single line
(cherry picked from commit 6225d43a70)
Fixes FabricBlockSettings' copyOf method missing several new settings introduced as a result of the removal of Materials.
Specifically, burnable, liquid, forceNotSolid, forceSolid, pistonBehavior, instrument, and replaceable. These are all copied by the vanilla `BlockSettings.copy` as well.
The emissiveLightingPredicate is also now copied in vanilla, so I moved the copy of that to reflect that change.
(cherry picked from commit 2ff98d3bac)
* Fix testmod calling Text#translatable with non-primitive arg
* Fix javadoc in BlockPickInteractionAware
There is no immediate need to change the param type, as the
world can be obtained from `player.getWorld()`.
* Fix unload events not running during reconfiguration
* Fix inconsistency of placed feature locations
`BiomeSource#getBiomes` mixin applies to all biome sources, including one for Overworld.
The return value is a set; however one caller in the worldgen code iterates over it: `PlacedFeatureIndexer`.
Using a hash set here randomizes the return value, affecting feature placement.
Use a linked hash set instead.
* Improve fix to only make changes when required.
---------
Co-authored-by: modmuss50 <modmuss50@gmail.com>
(cherry picked from commit 661cc8c6dc)