1.21.5 to 1.21.6 - 1.21.8
This is an overview on the breaking changes, deprecations, and future development plans for Curios on 1.21.6/1.21.7/1.21.8. This document aims to be exhaustive and list every relevant change in each section. If there are any missing pieces of information, please submit a PR to this repository or initiate a support request in the Discord server.
Breaking Changes
Non-Deprecated
Method
ICuriosItemHandler#loadDatapacks(new interface method)
Description
This method has been added as a part of some internal refactors to how the Curios inventory is loaded, to fix some edge-case bugs and streamline the flow overall. Custom implementations using this interface will need to override this method to respond to datapack loading and changes.
Class
ICuriosItemHandler(new interface extension)ICurioStacksHandler(new interface extension)IDynamicStackHandler(new interface extension)
Description
These three interfaces now extend the net.neoforged.neoforge.common.util.ValueIOSerializable to match the updated
serialization and deserialization methods in Minecraft that now use ValueInput and ValueOutput parameters instead
of NBT tags. Custom implementations will need to provide overrides for ValueIOSerializable#serialize and
ValueIOSerializable#deserialize.
Changes
Equip Events
Methods
CurioCanEquipEventconstructor(ItemStack, SlotContext, boolean)(new constructor)getOriginalEquipResult(new method)
CurioCanUnequipEventconstructor(ItemStack, SlotContext, boolean)(new constructor)getOriginalUnequipResult(new method)
Description
These two events each have a new constructor that takes in a boolean parameter instead of a TriState parameter.
Since the intention of the parameter is to be used as an original result, not final, switching it to a boolean offers
better clarity (note: the result of the event itself still returns a TriState). In addition, new methods have been
added to retrieve the original result for mods that rely on that information for its processing.
Methods
CurioChangeEventconstructor(LivingEntity, SlotContext, ItemStack, ItemStack)(new constructor)getSlotContext(new method)
Description
This replaces the previous constructor that only had identifier and index information to provide the full SlotContext
record for additional slot data queries.
Deprecations
Equip Events
Methods
CurioCanEquipEventconstructor(ItemStack, SlotContext, TriState)- Replaced by:
CurioCanEquipEvent#CurioCanEquipEvent(ItemStack, SlotContext, boolean)
- Replaced by:
CurioCanUnequipEventconstructor(ItemStack, SlotContext, TriState)- Replaced by:
CurioCanUnequipEvent#CurioCanUnequipEvent(ItemStack, SlotContext, boolean)
- Replaced by:
CurioChangeEventconstructor(LivingEntity, String, int, ItemStack, ItemStack)- Replaced by:
CurioChangeEvent#CurioChangeEvent(LivingEntity, SlotContext, ItemStack, ItemStack)
- Replaced by:
getIdentifiergetSlotIndex- Replaced by:
CurioChangeEvent#getSlotContext
- Replaced by:
Description
These deprecations follow the changes described above, replaced by an updated method.
Serialization
Methods
IDynamicStackHandlerserializeNBTdeserializeNBT(Tag)
ICurioStacksHandlerserializeNBTdeserializeNBT(Tag)
ICuriosItemHandlerwriteTagreadTag(Tag)
Description
These deprecations follow the changes to these three interfaces to extend ValueIOSerializable and use the
ValueIOSerializable#serialize and ValueIOSerializable#deserialize methods instead for serialization and
deserialization of Curios inventory data.