Skipping night skips season as well
Explodncheez opened this issue ยท 13 comments
I am using ToughAsNails version 1.9.4-1.0.4 with Biomes O' Plenty version 1.9.4-4.1.0.2033 and no other mods.
Whenever I sleep through the night in a bed, the season automatically moves to the next one, even if the current season just started (the wiki says they're normally suppose to last quite a few days).
Haven't seen any other issue point this out, so I thought I'd try dropping this here!
I'm looking at SeasonSleepHandler::onWorldTick. Not positive, but it appears to be basically adding world.getWorldInfo().getWorldTime() to seasonData.seasonCycleTicks every time someone sleeps. Is this truly the desired behavior? I haven't tracked down seasonData.seasonCycleTicks so perhaps it's not what it seems.
Sorry if I'm reviving something here, but this issue still occurs in the latest version of Tough As Nails, version 1.0.11. #132 also goes over this, with the season times being inconsistent, especially when sleeping. When I sleep in a bed, for me, it skips one whole season, for example, Winter -> sleep once -> Spring
Okay, I think I have a way of reliably reproducing this now. Could someone please confirm this is indeed the issue people are referring to.
- Place down a bed with a season clock in front of you
- Run
/tan setseason mid_summer
- Repeatedly run
/time add 5000000
until it is night - Sleep
- Season clock should jump waaaaaayy forward
I would like to point out the fix in the closing commit.
long i = (world.getWorldInfo().getWorldTime() % 24000L) + 24000L;
long timeDiff = i - i % 24000L;
This is always equal to a timeDiff of 24000L. Is that the desired behaviour? Just double checking.
Example: getWorldTime() returns values between 0 and 23999, inclusive. Let's use 23000
long i = (23000L % 24000L) + 24000L = 23000L + 24000L = 47000L
long timeDiff = 47000L - (47000L % 24000L) = 47000L - 23000L = 24000L
According to wiki entries on Day-night cycle and Bed, sleeping in a bed moves time to Dawn, which from what I understand is the 23460 tick of the cycle. "The exact tick time span during which a bed may be used at night is between 12541 and 23458, inclusive."
To make seasons more accurate, especially when beds are used often, I think the code can be changed to this.
long timeDiff = (23460L - (world.getWorldInfo().getWorldTime() % 24000L));
Thank you for the reply!
It makes sense that beds progress seasons along; however, my problem is that, for instance, if I sleep in a bed during mid-spring, I'll wake up at the beginning of autumn or winter or something, skipping a sizeable chunk of time (according to the season clock). If I don't sleep in a bed, time progresses as usual.
This occurs on a pure-survival world without cheats enabled.
I've tried and have been unsuccessful at replicating this bug on other newly-created worlds, so I'm assuming it's a one-time freakout or something? Strange that it only occurs on this one world...
Beds are indeed supposed to move the season progression along too. What I suspect happened here is that you just changed the sub season rather than the season (which also have distinct grass colours). Sub seasons are much shorter than seasons which probably is the cause of confusion here
Ah, another thing that might've happened is that apparently Forstride had the season sensor going anti-clockwise instead of clockwise (which should be fixed in the latest version, 1.0.5)
That wouldn't have really affected anything. The clock would've still shown the correct season, but the animation would've gone counter-clockwise instead of clockwise.
I will try to get a video clip of this.
Strangely, it doesn't seem to be reproducible by /time set and sleeping.
Edit: This is what happens - https://youtu.be/Uuznm70q8TI
Hello, i've been having the same issue happen to me on my current world, and while it's not exactly game breaking, it kinda removes from the season mechanic, as any temperature changes that would be dependant on seasons only last for a day or two.
Edit: I'm currently using Tough As Nails 1.0.10 and the latest forge version (12.18.1.2015)
Edit 2: I found the cause for the bugged behaviour to be the colored beds from the Quark mod, as the code from TAN seems to be linked to the vanilla minecraft bed only. I'll submit this bug report to Vazkii, in case the bug is caused by Quark's code.
Edit 3: ... It's happening again, this time with the vanilla bed, and i'm lost about what it could be.
For us, it seems that we start at spring after every server restart. We never saw autumn or winter on our server because of this.
Modlist: http://blog.terpo.org/upload/mc/modlist.txt
Minecraft: 1.10.2
Forge: 1.10.2 - 12.18.1.2011
ToughAsNails-1.9.4-1.0.10
This is indeed a whack bug. It is very hard to replicate. This generally happens after several hours of play when it happens to me, and I am not too sure what causes it, however I have done the following steps using NBTExplorer:
- Destroyed the nearby campfire that had been burning forever
- Exit gameplay returning to Minecraft's main menu
- Opened "seasons.dat" and made a note of the "SeasonCycleTicks: Value" within the map\data folder
- Deleted "seasons.dat"
- NBTEdited the map folder's "level.dat" setting the "DayTime" flag back to "0"
- Loaded up my saved world
- Immediately quit back to the main menu
- Opened "seasons.dat" and re-entered the previous "SeasonCycleTicks: Value"
- Loaded up my saved world
- Used a vanilla bed and everything was okay! The SeasonCycleTicks change from 74500 to 98500 instead of skipping entire seasons!
I hope this helps in any capacity!
EDIT:
Just spent the last few hours playing with just the ToughAsNails-1.9.4-1.0.10.jar without any other mod. From a fresh single player normal survival, before I used a bed I made a note of the following values:
- Level.dat - Day Time: Value
- Seasons.dat - SeasonCycleTicks : Value
Then straight after sleeping I noted the newly written SeasonCycleTicks: Value.
The sleeptime grows exponentially, here are the results!
Hope this helps!