mojira.dev
MC-230678

Cauldron fills with powder snow in frozen ocean biome while it's visually raining

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

  1. Find a frozen ocean, or create a superflat world with just frozen ocean

  2. Use /fill command to create a large layer of cauldrons under open sky

  3. Change weather to raining/snowing

  4. Observe that some cauldrons are filled with powder snow even if it is raining

  5. 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

Attachments

Comments 12

Can confirm in 1.17.1 Pre-release 2.

Can confirm in 1.17.1.

Can confirm in 21w37a.

Can confirm in 21w39a.

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.

2 more comments

Thanks for the new info! My initial analysis is incorrect, I overlooked some details.

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.19.

[media]

Can confirm in 1.19.1.

windwend

gegy

Confirmed

Normal

Block states, Particles

frozen_ocean

1.17, 1.17.1 Pre-release 2, 1.17.1, 21w37a, 1.18 Pre-release 6, ..., 1.19.1, 1.19.2, 22w42a, 1.19.3 Pre-release 2, 1.19.3

23w03a

Retrieved