Crafting Tweaks

Crafting Tweaks

109M Downloads

Crash (Server hangs in an infinite loop) when trying to compress with unusual recipes.

alcatrazEscapee opened this issue ยท 0 comments

commented

Minecraft Version

1.19.x

Mod Loader

Forge

Mod Loader Version

43.1.55

Mod Version

15.1.0

Describe the Issue

To Reproduce

  1. Add the provided datapack to a world. This adds a shapeless crafting recipe which crafts 9x dirt -> 9x dirt. Confirm this recipe does indeed work.
  2. Put 64x dirt in your inventory, first slot.
  3. Open crafting bench.
  4. Hover over your 64x dirt.
  5. Press K.
  6. Observe the server is now hung, and will not respond, requiring the server watchdog to kill it or die another way.

The Offending Datapack

crafting-tweaks-crash.zip

Explanation

https://github.com/ModdingForBlockheads/CraftingTweaks/blob/d725c7e99500925d7d92ff1d89c9d1ef75722dae/shared/src/main/java/net/blay09/mods/craftingtweaks/network/CompressMessage.java#L133-L141

This loop, and all others like it, make no gaurentee that it will terminate in the presence of specific modded recipes. In particular, this endlessly repeats the same recipe, doing absolutely nothing. This was first noticed in the presence of TerraFirmaCraft, which has a recipe which crafts food -> food, preserving the count, but combining the decay date of each food.

This was reproduced on both 1.19.1 with the versions listed here, and on 1.18.2 with TerraFirmaCraft. The code and diagnosis is the same in both cases.

Logs

https://paste.ee/p/9XvIj

Do you use any performance-enhancing mods (e.g. OptiFine)?

No.