mrh0 / createaddition

Create Crafts & Additions, Addon to the Create mod by the Create Team.
Other
84 stars 112 forks source link

[Fabric only] Liquid blaze burners use fuel at twice the expected rate #782

Open dhouck opened 6 months ago

dhouck commented 6 months ago

Describe the bug Liquid-fuel blaze burners decrement their time remaining twice per tick, so use fuel at twice the expected rate.

To Reproduce

  1. Place a blaze burner
  2. Give it a straw
  3. Give it a bucket of lava
  4. Wait 500 seconds (10,000 game ticks)
  5. Note that it has stopped burning.

Alternate steps 4 and 5: use Carpet mod to tick step and see that the burn time decreases by two each tick.

If you look at https://github.com/mrh0/createaddition/blob/bf11060351177ebe36c55a26157448f2a1bb0280/src/main/java/com/mrh0/createaddition/blocks/liquid_blaze_burner/LiquidBlazeBurnerBlockEntity.java#L210-L219 you can see that it decrements the counter no matter what, and then again if not creative.

If you look at the equivalent section of the Forge code, you see https://github.com/mrh0/createaddition/blob/e82c79e99a35c4d027f398bacb679e8d1fb114d2/src/main/java/com/mrh0/createaddition/blocks/liquid_blaze_burner/LiquidBlazeBurnerBlockEntity.java#L200-L206 there is only one decrement statement because the early-exit for creative (and the call to burningTick) is before the decrement.

Iʼm not sure if the Forge solution would work here; there are some differences in burningTick that mean it might run into issues based on whether itʼs before or after the decrement in the case where we are now out of fuel. But at the very least the first conditional should be removed.

Additional context

skippyall commented 6 months ago

I changed the order to make liquid blaze burners refill instantly (see also #726). I'd maybe do this on forge too because this might happen again next time we merge forge into fabric.