Closed Jummit closed 3 years ago
if you know a fix, please do make a PR
I think the issue here is that impostor recipes load using ShapedRecipe.itemStackFromJson
, which ignores the "nbt" tag (this is something that Forge adds), which means they all get the default colour (though this should be blue - surprising!). Either way, switching to something like this should work (though also untested, sorry).
public class CraftingHelper
{
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
private CraftingHelper()
{
}
@Nonnull
public static ItemStack getItemStack( JsonObject object )
{
ItemStack stack = ShapedRecipe.itemStackFromJson( object );
JsonElement element = object.get( "nbt" );
if( element != null )
{
try
{
stack.setTag( TagParser.parseTag( element.isJsonObject() ? GSON.toJson( element ) : GsonHelper.getAsString( object, "nbt" ) ) );
}
catch( CommandSyntaxException e )
{
throw new JsonSyntaxException( "Invalid NBT entry: " + e.getMessage() );
}
}
return stack;
}
}
Apologies for MojMap.
fixed with #75
All disks recipes show a white disk as result. This happens both in REI and in the vanilla recipe book.