EngineHub / CraftBook

🔧 Machines, ICs, PLCs, and more!
https://enginehub.org/craftbook/
GNU General Public License v3.0
301 stars 160 forks source link

Custom crafting recipe that has a reversal recipe causes stone to break. #1237

Closed mibby closed 3 years ago

mibby commented 3 years ago

Versions CraftBook version: 3.10.3-SNAPSHOT dev 4673 Bukkit version: Paper dev 323 (Spigot 1.16.4) WorldEdit version: 7.2.x dev 5524

Describe the bug If you have a custom crafting recipe that reverses into itself, it breaks the stone crafting recipe for buttons. Instead stone crafts into itself.

  coraltube1:
    type: shapeless
    ingredients:
      'tube_coral': 1
    results:
      'dead_tuba_coral': 1
  coraltube2:
    type: shapeless
    ingredients:
      'dead_tuba_coral': 1
    results:
      'tuba_coral': 1

To Reproduce

  1. Add two custom crafting recipes that reverse into each other.
  2. Put stone in a crafting table.
  3. Stone no longer crafts into a button; it's effectively broken. Stone -> Stone

Expected behavior Stone to work and craft into stone buttons.

Additional context Removing one of the recipes fixes stone, but then the custom recipe doesn't work. Changing the recipe requirements (such as amount) of one of them fixes stone as well, but then it's not a 1:1 crafting ratio.

me4502 commented 3 years ago

Everything is working correctly here. You've passed in an invalid block, which gets parsed as stone.

So you're creating recipes that override the normal stone button recipe.

mibby commented 3 years ago

How is it an invalid block? Both tube_coral & dead_tuba_coral exist. The recipe is to make them reversible so players can craft either dead or alive coral types freely. The recipe works fine as intended configured as such for both coral types; but stone ends up breaking for whatever reason.

Increasing one of the required counts on one of the reversal recipes fixes the stone issue.

me4502 commented 3 years ago

You've written dead_tuba_coral, rather than dead_tube_coral

mibby commented 3 years ago

Oh my god, I'm an idiot. But the recipe worked when testing... :(

Thanks, I'll correct it and give it another test.

Edit: Seems to work without issue, my apologies.