diff --git a/src/main/java/com/chaosthedude/naturescompass/util/BiomeUtils.java b/src/main/java/com/chaosthedude/naturescompass/util/BiomeUtils.java index 5986e59..a3cb21f 100644 --- a/src/main/java/com/chaosthedude/naturescompass/util/BiomeUtils.java +++ b/src/main/java/com/chaosthedude/naturescompass/util/BiomeUtils.java @@ -55,7 +55,7 @@ public static List getAllowedBiomeKeys(Level level) { Biome biome = entry.getValue(); if (biome != null) { Optional optionalBiomeKey = getKeyForBiome(level, biome); - if (biome != null && optionalBiomeKey.isPresent() && !biomeKeyIsBlacklisted(level, optionalBiomeKey.get())) { + if (biome != null && optionalBiomeKey.isPresent() && !biomeKeyIsBlacklisted(level, optionalBiomeKey.get()) && !biomeKeyIsHidden(level, optionalBiomeKey.get())) { biomeKeys.add(optionalBiomeKey.get()); } } @@ -233,6 +233,18 @@ public static boolean biomeKeyIsBlacklisted(Level level, ResourceLocation biomeK } return false; } + + public static boolean biomeKeyIsHidden(Level level, ResourceLocation biomeKey) { + if (getBiomeRegistry(level).isPresent() && getBiomeForKey(level, biomeKey).isPresent()) { + final Registry biomeRegistry = getBiomeRegistry(level).get(); + final Biome biome = getBiomeForKey(level, biomeKey).get(); + if (biomeRegistry.getResourceKey(biome).isPresent() && biomeRegistry.getHolder(biomeRegistry.getResourceKey(biome).get()).isPresent()) { + final Holder biomeHolder = biomeRegistry.getHolder(biomeRegistry.getResourceKey(biome).get()).get(); + return biomeHolder.tags().anyMatch(tag -> tag.location().getPath().equals("c:hidden_from_locator_selection")); + } + } + return false; + } private static String convertToRegex(String glob) { String regex = "^";