mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-09-12 15:25:58 +00:00
fix: recipe util set nbt correct nbt parsing
This commit is contained in:
@@ -12,7 +12,7 @@ import com.google.gson.*;
|
|||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import dan200.computercraft.shared.computer.core.ComputerFamily;
|
import dan200.computercraft.shared.computer.core.ComputerFamily;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NbtHelper;
|
import net.minecraft.nbt.StringNbtReader;
|
||||||
import net.minecraft.recipe.Ingredient;
|
import net.minecraft.recipe.Ingredient;
|
||||||
import net.minecraft.util.JsonHelper;
|
import net.minecraft.util.JsonHelper;
|
||||||
import net.minecraft.util.collection.DefaultedList;
|
import net.minecraft.util.collection.DefaultedList;
|
||||||
@@ -119,7 +119,7 @@ public final class RecipeUtil
|
|||||||
{
|
{
|
||||||
try
|
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 )
|
catch( CommandSyntaxException e )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user