Farmer's Delight

Farmer's Delight

97M Downloads

CuttingBoardRecipeWrapper thows exception in simple scenario - crashes server

klugemonkey opened this issue ยท 5 comments

commented

Minecraft version

1.21.1

Farmer's Delight version

1.2.5

NeoForge version

21.1.74

Description

CuttingBoardRecipeWrapper is throwing exception when there is no item for index 1, resulting in crash of server.
This should be handled better, and can be easily crashed by using a dispenser with a tool on a cutting board.

Steps to reproduce

Placed Dispenser facing into a Cutting Board. Dispenser contained a tool (Diamond Paxel) that is known to cut Amethyst Block on a Cutting Board. Cutting Board is fed Amethyst Blocks from Hopper on the opposite side of the Dispenser. Redstone Clock block is placed below the dispenser and a lever placed on it. Manually using the Paxel will work on the Amethyst Block to craft the recipe, however turning the lever on to automated the crafting throws the exception - crashing the server.

Mod list

Too many, this is on FTB Evolution 1.21 v 1.3.0.

Logs

https://mclo.gs/kp2uuZz

Minimal instance

  • I have tested this on a minimal instance

Performance and shader mods

  • I am using performance or shader mods
commented

In this case it's crashing the server on startup, with only remedy to remove mod or edit region file, so it should be classified as an exploit as well.

commented

Fixed on commit cb98a2d.

commented

CuttingBoardRecipeWrapper is indeed a new addition, and the crash was one of its own explicit throws. I need to check with the original collaborator about the purpose of this throw, as it seems getItem is being called for an improper index. Strange that it didn't replicate the crash, though.

commented

I wasn't able to replicate this on a minimal instance. My suspect was Polymorph, as the stacktrace shows its methods in the middle of the crash; but adding the version you are using didn't change the result.

I tested this setup:
image

Do you know if there are any other mods possibly meddling with recipe checks?

commented

Found the cause. The mod Recipe Essentials runs getItem() through the inventory to create a hash, and CuttingBoardRecipeWrapper throws if it's different than 0.

Nor sure why this throw exists, so I'll just remove it. Should be fixed on version 1.2.6 soon.