Skip to content

Commit 51985f8

Browse files
committed
Add latest porting guides
1 parent 8f90cfc commit 51985f8

3 files changed

Lines changed: 181 additions & 1 deletion

File tree

docs/curios/porting/1211to1214.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 1
33
---
44

5-
# 1.21.1 to 1.21.4/1.21.5
5+
# 1.21.1 to 1.21.4 - 1.21.5
66

77
This is an overview on the breaking changes, deprecations, and future development plans for Curios on 1.21.4/1.21.5. This document
88
aims to be exhaustive and list every relevant change in each section. If there are any missing pieces of information, please

docs/curios/porting/1215to1218.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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.

docs/curios/porting/1218to12111.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# 1.21.8 to 1.21.9 - 1.21.11
6+
7+
This is an overview on the breaking changes, deprecations, and future development plans for Curios on
8+
1.21.9/1.21.10/1.21.11. 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+
**Field**
17+
- `CuriosCapability#ITEM_HANDLER`
18+
- Type changed from `IItemHandler` to `ResourceHandler<ItemResource>`
19+
20+
**Description**
21+
22+
This change was made to conform to the new NeoForge transfer API, especially since the `IItemHandler` interface is
23+
marked as deprecated and for removal. Consumers that need the legacy behavior can use `IItemHandler#of(ResourceHandler)`
24+
as a wrapper for this return to get an `IItemHandler` instance.
25+
26+
**Method**
27+
- `ICurioRenderer`
28+
- `renderFirstPersonHand`
29+
- `ICurioRenderer#ModelRenderer`
30+
- `prepareModel`
31+
- `renderModel`
32+
- `renderFirstPersonHand`
33+
- Parameter changed from `MultiBufferSource` to `SubmitNodeCollector`
34+
35+
**Description**
36+
37+
These methods are updated to conform to vanilla's rendering changes that now use a `SubmitNodeCollector` parameter.
38+
39+
## Changes
40+
---
41+
### Rendering
42+
43+
**Methods**
44+
- `ICurioRenderer`
45+
- `render(
46+
ItemStack,
47+
SlotContext,
48+
PoseStack,
49+
SubmitNodeCollector,
50+
int,
51+
LivingEntityRenderState,
52+
RenderLayerParent,
53+
EntityRendererProvider.Context,
54+
float,
55+
float)` (new method)
56+
57+
**Description**
58+
59+
An updated `render` method has been added to conform to vanilla's rendering changes that now use a `SubmitNodeCollector`
60+
parameter. The default implementation currently redirects to the old method that uses a `MultiBufferSource` parameter.
61+
62+
## Deprecations
63+
---
64+
### Rendering
65+
66+
**Methods**
67+
- `ICurioRenderer`
68+
- `render` method that takes a `MultiBufferSource` parameter
69+
- Replaced by: `render` method that takes a `SubmitNodeCollector` parameter
70+
- `renderModel`
71+
- Replaced by: `net.minecraft.client.renderer.OrderedSubmitNodeCollector#submitModel`
72+
73+
**Description**
74+
75+
These deprecations follow the rendering changes described above, replaced by an updated method.

0 commit comments

Comments
 (0)