|
| 1 | +--- |
| 2 | +sidebar_position: 2 |
| 3 | +--- |
| 4 | + |
| 5 | +# 1.21.5 to 1.21.6 - 1.21.8 |
| 6 | + |
| 7 | +This is an overview on the breaking changes, deprecations, and future development plans for Curios on |
| 8 | +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 |
| 9 | +any missing pieces of information, please submit a PR to this repository or initiate a support request in the Discord |
| 10 | +server. |
| 11 | + |
| 12 | +## Breaking Changes |
| 13 | +--- |
| 14 | +### Non-Deprecated |
| 15 | + |
| 16 | +**Method** |
| 17 | +- `ICuriosItemHandler#loadDatapacks` (new interface method) |
| 18 | + |
| 19 | +**Description** |
| 20 | + |
| 21 | +This method has been added as a part of some internal refactors to how the Curios inventory is loaded, to fix some |
| 22 | +edge-case bugs and streamline the flow overall. Custom implementations using this interface will need to override this |
| 23 | +method to respond to datapack loading and changes. |
| 24 | + |
| 25 | +**Class** |
| 26 | +- `ICuriosItemHandler` (new interface extension) |
| 27 | +- `ICurioStacksHandler` (new interface extension) |
| 28 | +- `IDynamicStackHandler` (new interface extension) |
| 29 | + |
| 30 | +**Description** |
| 31 | + |
| 32 | +These three interfaces now extend the `net.neoforged.neoforge.common.util.ValueIOSerializable` to match the updated |
| 33 | +serialization and deserialization methods in Minecraft that now use `ValueInput` and `ValueOutput` parameters instead |
| 34 | +of NBT tags. Custom implementations will need to provide overrides for `ValueIOSerializable#serialize` and |
| 35 | +`ValueIOSerializable#deserialize`. |
| 36 | + |
| 37 | +## Changes |
| 38 | +--- |
| 39 | +### Equip Events |
| 40 | + |
| 41 | +**Methods** |
| 42 | +- `CurioCanEquipEvent` |
| 43 | + - `constructor(ItemStack, SlotContext, boolean)` (new constructor) |
| 44 | + - `getOriginalEquipResult` (new method) |
| 45 | +- `CurioCanUnequipEvent` |
| 46 | + - `constructor(ItemStack, SlotContext, boolean)` (new constructor) |
| 47 | + - `getOriginalUnequipResult` (new method) |
| 48 | + |
| 49 | +**Description** |
| 50 | + |
| 51 | +These two events each have a new constructor that takes in a `boolean` parameter instead of a `TriState` parameter. |
| 52 | +Since the intention of the parameter is to be used as an original result, not final, switching it to a `boolean` offers |
| 53 | +better clarity (note: the result of the event itself still returns a `TriState`). In addition, new methods have been |
| 54 | +added to retrieve the original result for mods that rely on that information for its processing. |
| 55 | + |
| 56 | +**Methods** |
| 57 | +- `CurioChangeEvent` |
| 58 | + - `constructor(LivingEntity, SlotContext, ItemStack, ItemStack)` (new constructor) |
| 59 | + - `getSlotContext` (new method) |
| 60 | + |
| 61 | +**Description** |
| 62 | + |
| 63 | +This replaces the previous constructor that only had identifier and index information to provide the full `SlotContext` |
| 64 | +record for additional slot data queries. |
| 65 | + |
| 66 | +## Deprecations |
| 67 | +--- |
| 68 | +### Equip Events |
| 69 | + |
| 70 | +**Methods** |
| 71 | +- `CurioCanEquipEvent` |
| 72 | + - `constructor(ItemStack, SlotContext, TriState)` |
| 73 | + - Replaced by: `CurioCanEquipEvent#CurioCanEquipEvent(ItemStack, SlotContext, boolean)` |
| 74 | +- `CurioCanUnequipEvent` |
| 75 | + - `constructor(ItemStack, SlotContext, TriState)` |
| 76 | + - Replaced by: `CurioCanUnequipEvent#CurioCanUnequipEvent(ItemStack, SlotContext, boolean)` |
| 77 | +- `CurioChangeEvent` |
| 78 | + - `constructor(LivingEntity, String, int, ItemStack, ItemStack)` |
| 79 | + - Replaced by: `CurioChangeEvent#CurioChangeEvent(LivingEntity, SlotContext, ItemStack, ItemStack)` |
| 80 | + - `getIdentifier` |
| 81 | + - `getSlotIndex` |
| 82 | + - Replaced by: `CurioChangeEvent#getSlotContext` |
| 83 | + |
| 84 | +**Description** |
| 85 | + |
| 86 | +These deprecations follow the changes described above, replaced by an updated method. |
| 87 | + |
| 88 | +### Serialization |
| 89 | + |
| 90 | +**Methods** |
| 91 | +- `IDynamicStackHandler` |
| 92 | + - `serializeNBT` |
| 93 | + - `deserializeNBT(Tag)` |
| 94 | +- `ICurioStacksHandler` |
| 95 | + - `serializeNBT` |
| 96 | + - `deserializeNBT(Tag)` |
| 97 | +- `ICuriosItemHandler` |
| 98 | + - `writeTag` |
| 99 | + - `readTag(Tag)` |
| 100 | + |
| 101 | +**Description** |
| 102 | + |
| 103 | +These deprecations follow the changes to these three interfaces to extend `ValueIOSerializable` and use the |
| 104 | +`ValueIOSerializable#serialize` and `ValueIOSerializable#deserialize` methods instead for serialization and |
| 105 | +deserialization of Curios inventory data. |
0 commit comments