Balm for Minecraft 1.21.1 has introduced load contexts, an object that you must pass to initializeMod and differs per loader.
Balm now requires a load context to be passed in when calling initializeMod in your entrypoints.
On Fabric and Forge, you can simply pass EmptyLoadContext.INSTANCE when calling initializeMod.
On NeoForge, you must pass a NeoForgeLoadContext which holds the mod event bus that was passed into the constructor of your NeoForge entrypoint.
@Override
public void onInitialize() {
Balm.initializeMod(Waystones.MOD_ID, EmptyLoadContext.INSTANCE, Waystones::initialize);
}
public NeoForgeWaystones(IEventBus modEventBus) {
final var context = new NeoForgeLoadContext(modEventBus);
Balm.initializeMod(Waystones.MOD_ID, context, Waystones::initialize);
}
To align with Vanilla, the encoder in registerClientboundPacket has had its parameters swapped. It is now a BiConsumer<RegistryFriendlyByteBuf, T> where T is your packet object.
Minecraft is also migrating its network protocol to use StreamCodecs, which are a composable way of declaring the structure of the data that gets sent and received. Therefore, the old methods that took a decoder and encoder function have been deprecated.
You can still use StreamCodec.of(encoder, decoder) to create a StreamCodec with imperative code, although it is recommended to migrate to using StreamCodec.composite(...), as this declarative approach is less error-prone.