Skip to content

Commit e7e3dce

Browse files
committed
update to 1.20.1
1 parent 8553bca commit e7e3dce

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

gradle.properties

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ archives_base_name = serialization_hooks
66
mod_version = 0.4.<build>
77

88
# https://fabricmc.net/develop
9-
minecraft_version = 1.19.3
10-
loader_version = 0.14.11
11-
fabric_version = 0.69.1+1.19.3
9+
minecraft_version = 1.20.1
10+
loader_version = 0.14.21
11+
fabric_version = 0.84.0+1.20.1
1212

1313
# Mappings
1414
# https://lambdaurora.dev/tools/import_quilt.html
15-
qm_version = 6
15+
qm_version = 5
1616
# https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
1717
parchment_version = 2022.10.16
1818

1919
# dev env mods
2020

2121
# https://modrinth.com/mod/sodium
22-
sodium_version = mc1.19.3-0.4.6
22+
sodium_version = mc1.20.1-0.4.10
2323
# https://modrinth.com/mod/lithium
24-
lithium_version = mc1.19.3-0.10.4
24+
lithium_version = mc1.20.1-0.11.2
2525
# https://modrinth.com/mod/iris
26-
iris_version = 1.19.3-v1.4.6
26+
iris_version = 1.20.1-v1.6.4
2727
# https://modrinth.com/mod/wthit
28-
wthit_version = fabric-6.1.1
28+
wthit_version = fabric-8.1.1
2929
# https://modrinth.com/mod/modmenu
30-
modmenu_version = 5.0.2
30+
modmenu_version = 7.1.0
3131
# https://modrinth.com/mod/badpackets
3232
bad_packets_version = fabric-0.3.4

src/main/java/io/github/tropheusj/serialization_hooks/mixin/IngredientMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static Value valueFromJson(JsonObject json) {
6464
* @reason to make JsonArray handling recursive, add custom object deserialization, and fast-fail in conflicts
6565
*/
6666
@Overwrite
67-
public static Ingredient fromJson(@Nullable JsonElement json) {
67+
public static Ingredient fromJson(@Nullable JsonElement json, boolean allowAir) {
6868
if (json == null || json.isJsonNull()) {
6969
throw new JsonSyntaxException("Item cannot be null");
7070
} else if (json.isJsonObject()) {
@@ -75,12 +75,12 @@ public static Ingredient fromJson(@Nullable JsonElement json) {
7575
return fromValues(Stream.of(valueFromJson(obj)));
7676
} else if (json.isJsonArray()) {
7777
JsonArray jsonArray = json.getAsJsonArray();
78-
if (jsonArray.size() == 0) {
78+
if (jsonArray.size() == 0 && !allowAir) {
7979
throw new JsonSyntaxException("Item array cannot be empty, at least one item must be defined");
8080
} else {
8181
List<Ingredient> nested = new ArrayList<>();
8282
for (JsonElement element : jsonArray) {
83-
nested.add(fromJson(element));
83+
nested.add(fromJson(element, allowAir));
8484
}
8585
// use vanilla method for vanilla ingredients
8686
if (nested.stream().allMatch(i -> i.getClass() == Ingredient.class)) {

0 commit comments

Comments
 (0)