The bug
Cauldrons are supposed to be filled with water while it's raining, and powder snow while it is snowing. Frozen oceans have a unique temperature gradient that makes it snow in certain places and rain in others. However, whenever a cauldron is placed in this biome, it is filled with powder snow regardless of which local region it is in, even if it is visually raining. Ice and snow are formed as normal (i.e. following the boundaries of the local temperature values).
How to reproduce
Find a frozen ocean, or create a superflat world with just frozen ocean
Use /fill command to create a large layer of cauldrons under open sky
Change weather to raining/snowing
Observe that some cauldrons are filled with powder snow even if it is raining
Replace the platform with solid blocks, and see how snow layers are formed normally
This bug does not exist for the deep frozen ocean biome.
Code analysis
Code analysis can be found in this comment.
Linked issues
relates to 3
Attachments
Comments 12
Ampolive, thanks for the code analysis. I was wondering, can you do some more code-digging to figure out why deep frozen ocean doesn't have this problem? You can post the code analysis for that under this issue as well.
In ServerLevel#tickChunk(...)
, this code sets the precipitation to SNOW
when the temperature is below 0.15, even if the biome has RAIN
.
...
Biome.Precipitation $$16 = this.getBiome($$12).getPrecipitation();
if ($$16 == Biome.Precipitation.RAIN && $$14.coldEnoughToSnow($$13)) {
$$16 = Biome.Precipitation.SNOW;
}
$$15.getBlock().handlePrecipitation($$15, (Level)this, $$13, $$16);
...
So, the temperature gradient is only respected if the biome precipitation is set to RAIN
. If the biome precipitation is set to SNOW
, then the cauldron will always fill with powder snow. Frozen oceans (not deep frozen oceans) have a biome precipitation set to SNOW
, so they never fill up with water.
net.minecraft.world.level.block.CauldronBlock.java (1.18.1, Mojang mappings)
...
@Override
public void handlePrecipitation(BlockState $$0, Level $$1, BlockPos $$2, Biome.Precipitation $$3) {
if (!CauldronBlock.shouldHandlePrecipitation($$1, $$3)) {
return;
}
if ($$3 == Biome.Precipitation.RAIN) {
$$1.setBlockAndUpdate($$2, Blocks.WATER_CAULDRON.defaultBlockState());
$$1.gameEvent(null, GameEvent.FLUID_PLACE, $$2);
} else if ($$3 == Biome.Precipitation.SNOW) {
$$1.setBlockAndUpdate($$2, Blocks.POWDER_SNOW_CAULDRON.defaultBlockState());
$$1.gameEvent(null, GameEvent.FLUID_PLACE, $$2);
}
}
...
Upon closer inspection, it seems that the opposite may happen in deep frozen oceans: cauldrons fill with water while it's snowing. It might be a different issue.
Can confirm in 1.17.1 Pre-release 2.