Skip to content

Commit

Permalink
Fixed underground temperature modifier being used for non-overworld b…
Browse files Browse the repository at this point in the history
…iomes
  • Loading branch information
Forstride committed Jan 5, 2024
1 parent 054a539 commit 71c6c9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.google.common.collect.Sets;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.tags.BiomeTags;
import net.minecraft.tags.FluidTags;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.Boat;
Expand Down Expand Up @@ -131,7 +132,7 @@ private static TemperatureLevel getBiomeTemperatureLevel(Level level, BlockPos p
Holder<Biome> biome = level.getBiome(pos);
float biomeTemperature = biome.value().getBaseTemperature();

if (pos.getY() > ModConfig.temperature.environmentalModifierAltitude || level.canSeeSky(pos))
if (!biome.is(BiomeTags.IS_OVERWORLD) || (pos.getY() > ModConfig.temperature.environmentalModifierAltitude || level.canSeeSky(pos)))
{
if (biome.is(ModTags.Biomes.ICY_BIOMES)) return TemperatureLevel.ICY;
else if (biome.is(ModTags.Biomes.COLD_BIOMES)) return TemperatureLevel.COLD;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome;
import net.minecraftforge.fml.ModList;
Expand Down Expand Up @@ -39,7 +40,7 @@ private static TemperatureLevel seasonModifier(Level level, BlockPos pos, Temper
Holder<Biome> biome = level.getBiome(pos);

// Only adjust if above the environmental modifier altitude
if (pos.getY() <= ModConfig.temperature.environmentalModifierAltitude && !level.canSeeSky(pos))
if (biome.is(BiomeTags.IS_OVERWORLD) && pos.getY() <= ModConfig.temperature.environmentalModifierAltitude && !level.canSeeSky(pos))
return current;

// Check if biome uses seasonal effects
Expand Down

0 comments on commit 71c6c9f

Please sign in to comment.