The bug
In frozen biomes, it looks like it's raining in some places and snowing in other places. But where it looks like it's raining, there are some glitches.
Cauldrons catch powder snow instead of water (MC-230678)
No particles when hit block.
No snow layer and ice generating when ticking chunks
Farmland cannot get water
Riptide trident doesn't work (MC-247836)
Zombies still burn in the daytime (MC-233893)
Endermen, snow golems, blazes and striders do not take damage
and so on
Code analysis
The reason is because the snowy (Biome.Precipitation.SNOW
in the code) biomes can't rain (Level.isRainingAt
in the code), but the frozen (Biome.TemperatureModifier.FROZEN
) biomes are warm enough to rain at random places.
Using Mojang mappings, 22w42a: In Level#isRainingAt(BlockPos)
:
...
public boolean isRainingAt(BlockPos $$0) {
if (!this.isRaining()) {
return false;
}
if (!this.canSeeSky($$0)) {
return false;
}
if (this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, $$0).getY() > $$0.getY()) {
return false;
}
Biome $$1 = this.getBiome($$0).value();
return $$1.getPrecipitation() == Biome.Precipitation.RAIN && $$1.warmEnoughToRain($$0);
}
...
We can see that the function only returns true if the biome precipitation is RAIN
. Frozen oceans have a biome precipitation of SNOW
, so this will always be false for frozen oceans. This return statement should probably be changed to something like
return ($$1.getPrecipitation() == Biome.Precipitation.RAIN || $$1.getPrecipitation() == Biome.Precipitation.SNOW) && $$1.warmEnoughToRain($$0);
How to reproduce
Create a new flat world with preset string:
minecraft:bedrock,5*minecraft:stone;minecraft:frozen_ocean
Run /weather rain
Find a places where it's raining rather than snowing
Attachments:
[media][media]
I have reopened this ticket as there are other unreported bugs caused by this issue, and I believe it would be counterproductive to split this into several tickets that are caused by the same piece of code.