Blood Magic

Blood Magic

94M Downloads

1.18.2 Primitive Fuel Cell has infinite uses

AvgustinaChi opened this issue ยท 4 comments

commented

Issue Description:

Note: If this bug occurs in a modpack, please report this to the modpack author. Otherwise, delete this line and add your description here. If this is a feature request, this template does not apply to you. Just delete everything.

What happens:

After smelting 128 items cell doesn't break and continues smelting, showing negative number of uses left.

fuel cell

What you expected to happen:

Fuel cell breaking after 128 uses.

Steps to reproduce:

  1. Put a fuel cell and clay in an ARC
  2. Wait
    ...

Affected Versions (Do not use "latest"):

  • BloodMagic: 1.18.2-3.2.5-40
  • Minecraft: 1.18.2
  • Forge: 1.18.2-forge-40.1.73
commented

Lmao, I guess that needs to be checked out! Weird how it only happens for the Fuel Cell.

commented

I've just run into this issue myself, with the 1.20.1 beta version.

If it helps, I believe I know the cause of the issue. The stack-shrinking logic located here is nested in an else clause, meaning that it will only execute if the preceding if statements evaluate to false (lines 384 and 395). This means that for any damageable item in the ARC_TOOL slot, the damage logic will run, but the stack size will not be decremented as the subsequent else block will not be performed.

commented

There is also tool breaking logic in the if statement that reduces the durability on line 390. It doesnt shrink the stack size as ARC tools only stack to 1 anyway but it would set the slot as an empty item stack once the durability is used up, breaking the tool in the process.
What I see is that the craftFurnace method calls consumeInventory with the breakTool parameter set to false which would explain why it doesnt actually void the item once its used up as it thinks it shouldnt do that.
I would assume this is a leftover used for the lava crystal but it should be handled by the else if on line 395 now

commented

Thank you stranger, I did not see that. In my rush to be helpful, I didn't double check my work.