Weekly Update Stuff is back! I do skip an update or two, if the changes are not noteworthy. This week, Mojang had a small changelog - but the code changes are big. So here they are.
Fabric API 0.87.2 for 23w35a was released, with several breaking changes.
- Data Generation API v13 and Recipe API v2 received significant changes to reflect vanilla code changes.
- Message API was bumped to v6. Vanilla
MessageDecorator
is now, once again, synchronous. Yes, I introduced a change that broke data packs. Sorry. - Object Builder API v12 just removes the deprecated
CriterionRegistry
.
Recipe and advancement code was refactored to use records. In addition, RecipeEntry
or AdvancementEntry
is used in many places where a raw recipe or advancement is used previously. As the name suggests, this is a pair of the ID and the value. If you want to get the recipe/advancement itself, call .value()
. In RecipeProvider
, exporter
is now of type RecipeExporter
, not Consumer<RecipeJsonProvider>
. The usage remains the same; to output a recipe, call accept
.
Recipes and ingredients are serialized to and from the disk using Codecs. Fabric API's CustomIngredientSerializer
now has codec
method that returns codec, instead of read
/write
taking JsonObject
. (read
/write
taking PacketByteBuf
still exists.) To make the migration easier, you can use Codecs#fromJsonSerializer
- though this is deprecated. Hey, learn codecs, it's fun once you get used to it!
Yarn mapping received a couple of renames. Most significantly, "input" and "output" are now called "ingredient" and "result".
- In
EntryListWidget#mouseClicked
, the mouse button is now automatically checked. OverrideisSelectButton
to allow right-clicking entries to select one. The checks in individual entries are now redundant. AbstractRedstoneGateBlock#canPlaceAbove
was added. As the name indicates, this checks if a gate can be placed above a certain block.MeleeAttackGoal#canAttack
was added. This is checked insideattack
method.- Several new codecs were added to
Codecs
:object2BooleanMap
,alternatively
(likeeither
, except they are of the same type), andcreateRecursive
, which is useful when a serialized field needs to reference the codec itself.