It's been a year since the first post of the Snapshot Document Series! This will continue for the foreseeable future. Anyway, it's another frogging week and a snapshot update!
Fabric Loader 0.14.14 was released last week, fixing a bug where mod initializers were run a little bit later.
Fabric API for 23w06a, version 0.73.5, contains breaking changes to Item Group API, Indigo, Rendering API (v1), and Transitive Access Wideners.
Damages can now be defined using dynamic registry, with data packs. This also removed the constant DamageSources. DamageSources class holds several methods to get the instances of DamageSource:
- targetEntity.damage(DamageSource.MAGIC, 4.0F);
- anotherEntity.damage(DamageSource.anvil(attacker), 1.0F);
+ targetEntity.damage(world.getDamageSources().magic(), 4.0F);
+ anotherEntity.damage(world.getDamageSources().fallingAnvil(attacker), 1.0F);getDamageSources method also exists in Entity as a shortcut.
To check if a damage is of a certain type, tags should be used. Several predicates related to damages have changed to reflect this. See the slicedlime video.
This snapshot fixed bugs related to game events not firing. Some methods now take the entity that caused the action, for use when emitting a game event. These are usually marked as @Nullable.
DrawableHelper received some renames:
drawCenteredText->drawCenteredTextWithShadowdrawStringWithShadow/drawWithShadow->drawTextWithShadow
ModelTransformation.Mode is replaced with ModelTransformationMode (notice the lack of dot). This is the only breaking change to Rendering API and Indigo.
ItemGroup.Builder#entries now expects a callback taking two arguments: DisplayContext, a new record, and ItemGroup.Entries.
private static final ItemGroup ITEM_GROUP = FabricItemGroup.builder(new Identifier(MOD_ID, "test_group"))
.icon(() -> new ItemStack(Items.DIAMOND))
- .entries((enabledFeatures, entries, operatorEnabled) -> {
+ .entries((context, entries) -> {
entries.add(TEST_ITEM);
})
.build();The context can also be obtained from FabricItemGroupEntries#getContext.
- References to "scoreboard tag" (
/tag) are now renamed to "command tag". ClientWorld#getStarBrightnessis renamed togetSkyBrightness.Vec3d#withBiasis renamed tooffset.Wearableis renamed toEquipment.Equipments must now also implementgetSlotTypemethod.Enchantment#typeis renamed totarget.
EntityType.Builder#disableTickingto make the entity untickable like markers. (Fabric API version also received this change.)EntityDamageS2CPacketthat is sent to the clients when an entity is damaged.PacketByteBuf#writeVector3fandwriteQuaternionfto write a vector or a quaternion.SummonCommand#summonto summon an entity.MathHelper#lerpoverload withfloat, int, int.ColorHelper.Argb#lerpthat interpolates the color.Codecs#QUATERNIONF,MATRIX4F, andAXIS_ANGLE4Fto serialize these objects using codecs.Nullablesthat deals with nullable values.Util#cachedMapperthat wraps a mapper function with cache.
VehicleInventoryno longer aggros the piglins by default.Entity#addPassengerno longer returns a boolean.Util#mapandmapOrElsehas moved toNullables.
Thank you!