Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lava bucket fueled steam boiler level dropping when refueed (blaze burners losing heat before being refueled) #3518

Closed
CZdigger146 opened this issue Jul 27, 2022 · 2 comments · Fixed by #3958
Labels
type: bug Issue where something isn't working

Comments

@CZdigger146
Copy link

CZdigger146 commented Jul 27, 2022

Describe the Bug

I have a lvl9 steam boiler (max lvl without blaze cakes) with 9 steam engines, 9 blaze burners, all refueled by lava buckets via a mechanical arm (only one arm, but going ar a very high speed, all support components like pumps and the arm is powered by a windmill). When a blaze "runs out", the mechanical arm quickly grabs a lava bucket and refuels it, returning an empty bucket to get filled.

But sometimes when a blaze runs out of fuel, the steam engine shafts just pop off like when you connect two shafts that rotate in different directions. Sometimes even the sorrounding components like gears or belts also pop off

I believe this is caused by the fact that lava buckets (and blaze cakes) can fuel a blaze burner only once, thus they need to run out and stop heating before it gets refueled again.

Reproduction Steps

The bug occurs sometimes when a burner is refueled, some patience might be required...

  1. Build a active steam boiler, blaze burners need to be refueled with lava buckets by a mechanical arm
  2. Start it up
  3. Wait until a blaze needs refueling
  4. Closely observe the boiler level and sometimes the level of boiler drops for a split second before the blaze gets refueled. This causes further issues like shafts popping off as the steam engines get confused

Expected Result

When a blaze burner is using lava buckets as fuel, they only get refueled once until it runs out completely. With other fuel sources, the blaze burner gets refueled multiple times at first, and then after some time the blaze is refueled with a single piece of fuel so it never runs out because it always "contains" at least two pieces of fuel.

Because of this, when a blaze looses heat for a split second, the boiler lvl drops by 1. The whole structure also "blinks" as it gets updated and the level drops. It's at this moment when the components pop off.

The thing I would expect is the blaze burner being able to get automatically refueled BEFORE it runs out when fueled by lava buckets (and blaze cakes do a simlar thing but with the superheating).
At least give mechanical arms more time to refuel the burners before they run out, similar to how conventional fuels like coal work.

Also it would be nice if the steam engines wouldn't destroy every connected component when a boiler updates it's stats. No idea how that's happening nor how would I fix it though.

Screenshots and Videos

I wasn't able to capture the actual blaze burners losing heat as it happens so quickly, but here's what happens with the boiler after the bug:

How the boiler is supposed to look:
https://i.imgur.com/UgLMEif.png
2022-07-27_12 47 55

How it usually looks:
https://i.imgur.com/ZJeplCn.pn
2022-07-27_12 44 14

Sometimes even some belts or shafts further down the line get popped off as well, mostly on chunk borders

Crash Report or Log

N/A

Operating System

Windows 11

Mod Version

0.5.0c

Minecraft Version

1.18.2

Forge Version

40.1.60

Other Mods

Other mods shouldn't be a problem as we're running mostly QOL mods, create and quark. Otherwise it's basically vanilla
obrazek

Additional Context

We are playing on a dedicated server, also the whole area is chunkloaded thanks to chicken chunks mod (first hypothesis was that the shafts pop off when the chunk is loaded/unloaded by a player. Chunkloading did not fix this).

I'd be happy to share more info if needed to help getting this fixed!

EDIT for anyone with the same problem: When I removed one steam engine, it seems to be working correctly and no shafts are popping off. It's not great as you loose one whole engine but at least it's reliable now.

@CZdigger146 CZdigger146 added the type: bug Issue where something isn't working label Jul 27, 2022
@github-actions github-actions bot added the 1.18 label Jul 27, 2022
@zasrin
Copy link

zasrin commented Jul 30, 2022

I am also running into the issue. My boilers will randomly seize up because their level drops briefly due to the delay in feeding the blazes.

@NotSoEpic
Copy link
Contributor

The problem seems to be caused by these few line of code

When a blaze burner is unfueled, inserting lava completely skips over it (FuelType.NORMAL != FuelType.NONE). The burn time is only clamped in that if statement so that's why it lasts for the full 16.7 minutes instead of the capped 8.3 minutes.
When it is fueled though, attempting to insert lava will always cause remainingBurnTime + newBurnTime > MAX_HEAT_CAPACITY to be true, since newBurnTime > 10000. forceOverflow is false only if the insert attempt is from a fake player.
Therefore, when a mechanical arm checks to see if it can insert a lava bucket, it will always return false (can't insert) if the burner is fueled. This causes the momentary drop because the arm will never proactively refill when the burn time gets low.
This also explains why adding any fuel to an overfilled burner will reduce the burn time; It's only clamped when the fuel type isn't changed.

There probably several ways to fix this, so I'll just give two as an example:

  • Replace newBurnTime = ForgeHooks.getBurnTime(itemStack, null); on line 195 with newBurnTime = Math.min(ForgeHooks.getBurnTime(itemStack, null), MAX_HEAT_CAPACITY * 0.98);
    • Puts an upper cap on an items burn time to 98% of the maximum burn time, 9800 ticks or 8.1 minutes
  • Replace remainingBurnTime + newBurnTime > MAX_HEAT_CAPACITY on line 212 with (remainingBurnTime + newBurnTime > MAX_HEAT_CAPACITY || remainingBurnTime < 200)
    • Allows refueling if it has less than 10 seconds left of burning, even if that would go over the maximum burn time
    • Still leaves in the overfilling glitch when starting from smouldering

NotSoEpic added a commit to NotSoEpic/Create that referenced this issue Oct 29, 2022
Currently when inserting an item that smelts > 50 items such as lava buckets into an unfueled blaze burner, its burn time will go over maximum.
This fixes that by limiting added burn time from a single item to 98% of max burn time.
Also fixes Creators-of-Create#3518
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issue where something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants