It's 22w43a - where future awaits in the DataGen, literally.
fabric-data-generation-api-v1
received breaking changes, of course.
Data generators now have to create a "pack" and add providers to the pack. (It's like a resource pack - the provider generates a resource for a specific pack.) This can be done with FabricDataGenerator#createPack
(or create
, depending on FAPI version).
FabricDataGenerator.Pack pack = dataGenerator.createPack();
pack.addProvider(YourProvider::new);
There is another big refactor: DataProvider#run
is now CompletableFuture
-ified. This shouldn't affect FAPI-based datagen (as they don't expose this), but keep in mind in case some weird code uses thread-unsafe access. The DataCache
class is refactored to add an intermediary cache layer with concurrent write support.
Finally, a breaking change on FAPI side: providers now take FabricDataOutput
instead of FabricDataGenerator
, following the 22w42a change and some discussions. This means that providers can no longer access the data generator instance.
There's a new builder class for building widgets (such as buttons), which are now used in various places.
Vec3f
(mutable float vec3) is replaced with a new library, JOML. Apparently this benefits performance. Vec3d
(immutable double vec3) and Vec3i
(immutable* int vec3) are not affected and do still exist. Additionally, quaternion and matrices implementations are now also from JOML. Note, JOML classes are all mutable.
// Old code
Vec3f vec = new Vec3f(0.0f, 0.0f, 0.0f);
float x = vec.getX();
// New code
Vector3f vec = new Vector3f(0.0f, 0.0f, 0.0f);
float x = vec.x();
Codecs
received new codecs forJsonElement
,Text
,Vector3f
,BitSet
, and three authlib classes:GameProfile
,PropertyMap
, andProperty
.Entity#extinguishWithSound
, which extinguishes fire and plays the extinguish sound.DamageSource
methods to replace static fields, includingfallingBlock
,anvil
, andfallingStalactite
.PositionedDamageSource
, which is a non-entity damage source coming from a certain position (such as bed exploding).Explosion#getEntity
, which returns the entity that caused the explosion (ornull
).PlayerSessionC2SPacket
, which is a packet sent by a client to refresh its player session.InventoryOwner#readInventory
andwriteInventory
to properly deserialize and serialize entity inventory data to NBT.BlockPos#toCenterPos
, which returns theVec3d
representing the block position's center.Vec3d#toVector3f
, which convertsVec3d
to JOMLVector3f
.World#createExplosion
overload that takes aVec3d
.PointOfInterestTypes#isPointOfInterest
, which returns whether a given block state is a POI.
ItemGroups.NATURE
is renamed toNATURAL
.JumpingMount#getDashCooldown
is renamed togetJumpCooldown
. Guess this is not aDashingMount
.ProfileKeys
code is moved toProfileKeysImpl
.ProfileKeys
is now an interface.
- Library updates: Gson is now 2.9.1 (from 2.8.9), OSHI is now 6.2.2 (from 5.8.5), Guava is now 31.1 (from 31.0.1), ICU4J is now 71.1 (from 70.1), Mojang Logging is now 1.1.1 (from 1.0.0), Netty is now 4.1.82 (from 4.1.77), fastutil is now 8.5.9 (from 8.5.6), JNA is now 5.12.1 (from 5.10.0), HTTPCore is now 4.4.15 (from 4.4.14), Log4J is now 2.19.0 (from 2.17.0), and SLF4J is now 2.0.1 (from 1.8.0-beta4).
- Data tracker syncing has been optimized.
Matrix4f
is now in JOML lib and so isVec4f
->Vector4d