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 DamageSource
s. 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
->drawCenteredTextWithShadow
drawStringWithShadow
/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#getStarBrightness
is renamed togetSkyBrightness
.Vec3d#withBias
is renamed tooffset
.Wearable
is renamed toEquipment
.Equipment
s must now also implementgetSlotType
method.Enchantment#type
is renamed totarget
.
EntityType.Builder#disableTicking
to make the entity untickable like markers. (Fabric API version also received this change.)EntityDamageS2CPacket
that is sent to the clients when an entity is damaged.PacketByteBuf#writeVector3f
andwriteQuaternionf
to write a vector or a quaternion.SummonCommand#summon
to summon an entity.MathHelper#lerp
overload withfloat, int, int
.ColorHelper.Argb#lerp
that interpolates the color.Codecs#QUATERNIONF
,MATRIX4F
, andAXIS_ANGLE4F
to serialize these objects using codecs.Nullables
that deals with nullable values.Util#cachedMapper
that wraps a mapper function with cache.
VehicleInventory
no longer aggros the piglins by default.Entity#addPassenger
no longer returns a boolean.Util#map
andmapOrElse
has moved toNullables
.
awesome