The bug
Wolves do not get wet when raining in Frozen Oceans.
Expected result
Wolves would get wet when raining in Frozen Oceans.
Code analysis
Code analysis and potential fix can be found in this comment.
Linked issues
is caused by 1
relates to 1
Attachments
Comments 6
Code analysis (Mojang mappings, 22w42a): In Wolf#tick()
, Entity#isInWaterRainOrBubble()
is called, which in turn calls Level#isRainingAt(BlockPos)
. Taking a look at the function:
...
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);
Edit: I have tested this in 1.19.2 with my extremely limited modding capabilities and verified that this fixes this issue, MC-233893, and MC-247836. I am unsure if it causes other issues, however.
Edit 2: this is now tracked separately at MC-255811.
Appears to be fixed for me in 23w03, most likely due to MC-255811 being fixed. Someone please double check.
Relates to MC-230678 and MC-238904.