1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-29 00:32:18 +00:00

fix: recipe util set nbt correct nbt parsing

This commit is contained in:
Nikita Savyolov 2021-10-11 22:49:37 +03:00
parent 96c80a6549
commit 316889dab7
No known key found for this signature in database
GPG Key ID: 32C1EF023AFC184B

View File

@ -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 )
{