TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Barrels do not use `ICalendarTickable` to protect against time spent unloaded, resulting in recipes and ingredients rotting out of expected order

Grigoriewich opened this issue · 3 comments

commented

Describe the bug
I wanted to make vinegar
I made corn whiskey
Waited for ripening apples
Gathered fresh apples and put them in whiskey
I sealed the barrels, left the game and went to work
In the evening I came home from work, entered the game and saw that three months had passed
In the barrels, apples simply rotted, and vinegar was not produced.
This was not before when I was in a vinegar production game.
2020-06-16_20 17 25
2020-06-16_20 17 37
Let me remind you Apples were fresh.

Meta Info

  • TFC Version: 1.4.0.149
  • Were any other mods included? Can you reproduce it without these other mods?
    modlist
    I can’t play it yet. It takes a long time to harvest.
  • If necessary, what other mods (including versions) MUST be present to experience the bug?
commented

Can you reproduce this without leaving the game running for 3 months?

commented

@eerussianguy In theory yes, using /timetfc.

However this looks like a pretty expected situation: the barrel loads, and checks it's recipe, which is invalid (as the ingredient has rotted since). This:

Vinegar is not made when the chunk is not loaded

is kind of a "no shit sherlock", nothing can happen while a chunk is unloaded. We just try and fake it with time tracking.

If we were to solve this, I believe TEBarrel needs to properly implement ICalendarTickable and delegate recipe checks during aforementioned updates to CalendarTFC#runTransaction. However that's potentially a big pile of "simulate everything which has occurred since load".

We do this so some extent (for example, the charcoal forge will consume fuel, but will not actually heat), because it's physically impossible for us to identically simulate what would've occurred. So we have to make compromises where possible in order to be able to efficiently post-load update a TE without causing massive lag spikes.

commented

I have no right to use such commands. This happened on a test server. I can not influence the time. Some products at this time deteriorated by expiration date. Animals grew, the crop in the garden froze. And that’s all right. But apples in alcohol have deteriorated, and this is not right.