From 0db72ac19e735d398e85b2152d5a32317bb03dc8 Mon Sep 17 00:00:00 2001 From: Joseph Burton Date: Thu, 2 May 2024 20:23:15 +0200 Subject: [PATCH] Fix can_place_on conversion and size check for item containers --- patches/server/0976-Rewrite-dataconverter-system.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/server/0976-Rewrite-dataconverter-system.patch b/patches/server/0976-Rewrite-dataconverter-system.patch index b37d24f651..d12fd08743 100644 --- a/patches/server/0976-Rewrite-dataconverter-system.patch +++ b/patches/server/0976-Rewrite-dataconverter-system.patch @@ -6572,7 +6572,7 @@ index 0000000000000000000000000000000000000000..4fa31e40b0a6f571a853299b4e242de9 +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/itemstack/ConverterItemStackToDataComponents.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/itemstack/ConverterItemStackToDataComponents.java new file mode 100644 -index 0000000000000000000000000000000000000000..1354b139f929010bdb090764d6151ac9569df753 +index 0000000000000000000000000000000000000000..a5a21d1c7579e45b78eae4b42a9f023db74acc0a --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/itemstack/ConverterItemStackToDataComponents.java @@ -0,0 +1,1244 @@ @@ -6816,7 +6816,7 @@ index 0000000000000000000000000000000000000000..1354b139f929010bdb090764d6151ac9 + case "minecraft:crafter": { + final ListType items = tileEntity.getList("Items", ObjectType.MAP); + tileEntity.remove("Items"); -+ if (items != null && items.size() > 1) { ++ if (items != null && items.size() > 0) { + transientItem.componentSetList("minecraft:container", items); + + for (int i = 0, len = items.size(); i < len; ++i) { @@ -22437,7 +22437,7 @@ index 0000000000000000000000000000000000000000..f50b81d931a1908d405bb72e0679983a +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3818.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3818.java new file mode 100644 -index 0000000000000000000000000000000000000000..15257d47a2c449290e428402a9fa1e955f07e341 +index 0000000000000000000000000000000000000000..29d256c2f5d5e338dc7abeb82c0f1ae99ee1edf7 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3818.java @@ -0,0 +1,339 @@ @@ -22678,7 +22678,7 @@ index 0000000000000000000000000000000000000000..15257d47a2c449290e428402a9fa1e95 + walkBlockPredicates(canBreak, fromVersion, toVersion); + } + -+ final MapType canPlaceOn = root.getMap("minecraft:can_break"); ++ final MapType canPlaceOn = root.getMap("minecraft:can_place_on"); + if (canPlaceOn != null) { + final ListType predicates = canPlaceOn.getList("predicates", ObjectType.MAP); + if (predicates != null) {