Minecraft 1.21.9
These migration notes cover only the changes made to Balm APIs.
For Minecraft and mod-loader specific migrations, check out their respective release announcements or primers.
Overview
In Minecraft 1.21.9, some deprecated methods regarding to de/serialization have been removed. Key categories are now a record instead of a plain string, and are now namespaced.
⚠️ Known Issues
/balm export icons is not yet functional
The command has not yet been updated to Minecraft's rendering changes.
Breaking Changes
BalmKeyMappings.registerKeyMapping now takes a KeyMapping.Category instead of a string
Minecraft provides a static register method to create these. Consider using Kuma instead, which is embedded in Balm.
Kuma's overrideCategory now takes a KeyMapping.Category instead of a string
Minecraft provides a static register method to create these.
Kuma's default key category is now {modId}.default (i.e. key.categories.{modId}.default)
You will have to update your language files. This is because Minecraft now uses resource locations instead of plain strings for key categories.
Balm.lookupAllModPaths has been removed in favor of Balm.visitModResources
This was necessary as NeoForge no longer provides Paths for mod resources. The visitor receives a ModResource object for every item under the given path, which can be used to read the file (equivalent to doing Files.walk on the returned paths previously).
While lookupAllModPaths looked up paths in all loaded mods and returned them mapped by mod id, visitModResources expects a mod id to be passed in. You can get a list of all loaded mod ids using Balm.getLoadedPrimaryModIds. This will only return real mod ids, it does not include "provided" ids by Fabric mods.
Balm.lookupModPath has been removed in favor of Balm.lookupModResource
As above, this will now return an optional ModResource object instead of a Path.
Removals
DefaultContainer.deserialize and DefaultContainer.serialize has been removed in favor of ContainerHelper.loadAllItems and ContainerHelper.saveAllItems
Use net.minecraft.world.ContainerHelper#loadAllItems(ValueInput, NonNullList) and net.minecraft.world.ContainerHelper#saveAllItems(ValueOutput, NonNullList) instead, which are identical.
ImplementedContainer.deserializeInventory and ImplementedContainer.serializeInventory have been removed in favor of ContainerHelper.loadAllItems and ContainerHelper.saveAllItems
Use net.minecraft.world.ContainerHelper#loadAllItems(ValueInput, NonNullList) and net.minecraft.world.ContainerHelper#saveAllItems(ValueOutput, NonNullList) instead, which are identical.
DefaultFluidTank.deserialize and DefaultFluidTank.serialize methods based on CompoundTag have been removed in favor of their ValueInput and ValueOutput variants
Use the methods of same name that take a ValueOutput or ValueInput instead.
DefaultEnergyStorage.deserialize and DefaultEnergyStorage.serialize have been removed in favor of their ValueInput and ValueOutput variants
Use the methods of same name that take a ValueOutput or ValueInput instead. Note that, unlike the removed methods, these methods write into an "Energy" key instead of returning an IntTag directly. You may have to migrate data manually if you want to support upgrading older worlds.