From 8d22fabd4d373090b0fd2b9cf99d82857cb8c5af Mon Sep 17 00:00:00 2001 From: Forstride Date: Thu, 1 Feb 2024 05:00:07 -0500 Subject: [PATCH] Fixed edge case with 3D biomes causing ice to not melt (Closes #409) --- .../season/RandomUpdateHandler.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/sereneseasons/season/RandomUpdateHandler.java b/common/src/main/java/sereneseasons/season/RandomUpdateHandler.java index 0caca797..1ae67a3a 100644 --- a/common/src/main/java/sereneseasons/season/RandomUpdateHandler.java +++ b/common/src/main/java/sereneseasons/season/RandomUpdateHandler.java @@ -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 = world.getBiome(topAirPos); + Holder 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); + } } } }