From 316889dab7ec22dd22877c73c6de1fab68bf611d Mon Sep 17 00:00:00 2001 From: Nikita Savyolov Date: Mon, 11 Oct 2021 22:49:37 +0300 Subject: [PATCH] fix: recipe util set nbt correct nbt parsing --- .../java/dan200/computercraft/shared/util/RecipeUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dan200/computercraft/shared/util/RecipeUtil.java b/src/main/java/dan200/computercraft/shared/util/RecipeUtil.java index 8e07ed89a..167933b8e 100644 --- a/src/main/java/dan200/computercraft/shared/util/RecipeUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/RecipeUtil.java @@ -12,7 +12,7 @@ import com.google.gson.*; import com.mojang.brigadier.exceptions.CommandSyntaxException; import dan200.computercraft.shared.computer.core.ComputerFamily; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtHelper; +import net.minecraft.nbt.StringNbtReader; import net.minecraft.recipe.Ingredient; import net.minecraft.util.JsonHelper; import net.minecraft.util.collection.DefaultedList; @@ -119,7 +119,7 @@ public final class RecipeUtil { try { - itemStack.setNbt( NbtHelper.method_32260( nbtElement.isJsonObject() ? GSON.toJson( nbtElement ) : nbtElement.getAsString() ) ); + itemStack.setNbt( StringNbtReader.parse( nbtElement.isJsonObject() ? GSON.toJson( nbtElement ) : JsonHelper.asString( nbtElement, "nbt" ) ) ); } catch( CommandSyntaxException e ) {