MrCrayfish's Gun Mod

MrCrayfish's Gun Mod

25M Downloads

Exception in Recipe Serializer

dshadowwolf opened this issue ยท 6 comments

commented

The WorkbenchRecipeSerializer code throws an exception of "result" is not found in a recipe. This code appears to be identical to what is in the Vehicle Mod, as its text is "Missing Vehicle entry" instead of something that actually makes sense for the code, such as "Missing Recipe Result".

Ran into this when someone asked for help after getting the above error when trying to add a recipe using CraftTweaker and its IRecipeManager.addJSONRecipe() syntax, where they had mistakenly used "results" instead of "result". The bad exception text meant that figuring out the issue took actually going into the code to see how a recipe that, at a quick glance, matched the format was expected to have a vehicle.

commented
{
  "type": "vehicle:workstation",
  "vehicle": "vehicle:mini_bus",
  "materials": [
    {
      "tag": "forge:ingots/iron",
      "count": 128
    },
    {
      "item": "minecraft:gray_wool",
      "count": 5
    },
    {
      "tag": "forge:glass_panes",
      "count": 9
    },
    {
      "item": "minecraft:redstone",
      "count": 12
    },
    {
      "item": "vehicle:panel",
      "count": 16
    }
  ]
}
commented

Also wrong repository

commented

Don't use CraftTweaker, just use a datapack to override the recipe. Also "result" should be "vehicle"

commented

The error came from "Crayfish Gun Mod" so no, not wrong repository.

Check the file - it literally has Missing Vehicle entry for the exception and it will trigger even from a datapack if the result part is missing. (or if, like in this case, they specify results instead of result)

commented

My bad, I'll get this fixed

commented

Fixed in recent versions