![Harvest Festival](https://media.forgecdn.net/avatars/thumbnails/50/990/256/256/636098088923181921.png)
[1.10.2] Snow never melts after Winter
kwpugh opened this issue ยท 4 comments
Forge: 2095
Mod: 0.5.6
Modpack: https://minecraft.curseforge.com/projects/pughland-plethora
After Winter, through Spring, Summer, and Autumn, snow doesn't melt, even in the desert.
Known, it's just trying to work out a way that doesn't cause too much lag. I may have
to switch to a cosmetic snow layer or something.
I would do it identically to how the snow is deposited, just randomized checks on a few blocks at a time, could be sped up while raining, and stop doing the checks if so many times in a row come back not having destroyed any snow piles. I would continue doing the checks even after they officially stopped during rainy days, but at a reduced rate to clean up any snow that somehow escaped. Essentially pick (some number of) X and Z coordinates at random, search down from sky (don't know if there's a faster way to do this) and if the first thing you hit is a snow sheet, destroy it. Do this once a tick. Theoretically you should have most of it cleaned up if you check five spots per tick for five minutes. But then you've got the problem of unloaded chunks, where snow may have hidden out... You could keep a list of chunks that were visited while it was snowing and just remove the snow in those chunks when they're visited again, hitting each X and Z in the chunk exactly once, but in a randomized order over a few minutes... Looking at a worst case of 262,144 runs through the algorithm on view distance 32 when the player first wakes up...
For some reason my math this time says 43 spots per tick would be five minutes, which doesn't make any sense, so my math is wrong in one these examples >.>
Either way you might want to do it more slowly than that anyway so that there's still snow into the early days of spring...
Barring that method, just changing the grass blocks to snowy grass blocks would be fine, kind of like how all the leaf blocks change color, not sure how you'd do it, but I'd look into tricking minecraft into thinking every grass block has snow on it somehow... There must be a check in the rendering code somewhere, just hook into that check and during the appropriate season override it with code that always returns true...
|| >.> Never modded minecraft, but I program things sometimes...
Meh. The way I do it, the snow is normally cleared within like 7 days. It pretty much randomly removes 2/3rds of the snow at once. Which IMO is better than constant updates. Which would be much laggier. And even before I redid this, before the snow was mostly melting for me by the end of spring anyway, with the random updates. I would like to do a render eventually, but that's more effort than I want to put in to this right now :P.
Either way in my testing it didn't actually lag for me.