Skip to content

Commit

Permalink
Fixed edge case with 3D biomes causing ice to not melt (Closes #409)
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Feb 1, 2024
1 parent fde227f commit 8d22fab
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions common/src/main/java/sereneseasons/season/RandomUpdateHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,22 @@ private static void meltInChunk(ChunkMap chunkMap, LevelChunk chunkIn, float mel
BlockState aboveGroundState = world.getBlockState(topAirPos);
BlockState groundState = world.getBlockState(topGroundPos);
Holder<Biome> biome = world.getBiome(topAirPos);
Holder<Biome> groundBiome = world.getBiome(topGroundPos);

if (biome.is(ModTags.Biomes.BLACKLISTED_BIOMES))
return;
if (!biome.is(ModTags.Biomes.BLACKLISTED_BIOMES) && SeasonHooks.getBiomeTemperature(world, biome, topGroundPos) >= 0.15F)
{
if (aboveGroundState.getBlock() == Blocks.SNOW)
{
world.setBlockAndUpdate(topAirPos, Blocks.AIR.defaultBlockState());
}
}

if (SeasonHooks.getBiomeTemperature(world, biome, topGroundPos) >= 0.15F)
if (!groundBiome.is(ModTags.Biomes.BLACKLISTED_BIOMES) && SeasonHooks.getBiomeTemperature(world, groundBiome, topGroundPos) >= 0.15F)
{
if(aboveGroundState.getBlock() == Blocks.SNOW) world.setBlockAndUpdate(topAirPos, Blocks.AIR.defaultBlockState());
else if(groundState.getBlock() == Blocks.ICE) ((IceBlock) Blocks.ICE).melt(groundState, world, topGroundPos);
if (groundState.getBlock() == Blocks.ICE)
{
((IceBlock) Blocks.ICE).melt(groundState, world, topGroundPos);
}
}
}
}
Expand Down

0 comments on commit 8d22fab

Please sign in to comment.