Fixed null pointer with isTropical predicate.
@@ -3,14 +3,13 @@ package com.ferreusveritas.dynamictrees.compat;
import com.ferreusveritas.dynamictrees.DynamicTrees;
import com.ferreusveritas.dynamictrees.compat.seasons.*;
import net.minecraft.util.RegistryKey;
+import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Tuple;
import net.minecraft.util.registry.Registry;
import net.minecraftforge.fml.ModList;
import sereneseasons.config.BiomeConfig;
import sereneseasons.config.SeasonsConfig;
-import java.util.Objects;
-
/**
* @author Harley O'Connor
*/
@@ -28,8 +27,10 @@ public final class CompatHandler {
new Tuple<>(new SeasonProviderSereneSeasons(), new SeasonGrowthCalculatorActive()) :
new Tuple<>(new SeasonProviderNull(), new SeasonGrowthCalculatorNull())
);
- seasonManager.setTropicalPredicate((world, pos) -> BiomeConfig.usesTropicalSeasons(RegistryKey.create(Registry.BIOME_REGISTRY,
- Objects.requireNonNull(world.getBiome(pos).getRegistryName()))));
+ seasonManager.setTropicalPredicate((world, pos) -> {
+ final ResourceLocation biomeResLoc = world.getBiome(pos).getRegistryName();
+ return biomeResLoc != null && BiomeConfig.usesTropicalSeasons(RegistryKey.create(Registry.BIOME_REGISTRY, biomeResLoc));
+ });
SeasonHelper.setSeasonManager(seasonManager);
}
