Corrected checks

This commit is contained in:
Oak 2025-06-19 21:22:06 +01:00
parent d8524603c6
commit d71c6bb25f

View File

@ -95,12 +95,14 @@ public class CommonListener implements Listener {
NamespacedKey biomeKey = wolf.getWorld().getBiome(wolf.getLocation()).getKey(); NamespacedKey biomeKey = wolf.getWorld().getBiome(wolf.getLocation()).getKey();
pack.getBiomeProvider().stream() pack.getBiomeProvider().stream()
.map(biome -> ((BukkitPlatformBiome) biome.getPlatformBiome()).getContext() .filter(biome -> ((BukkitPlatformBiome) biome.getPlatformBiome()).getHandle()
.get(BukkitBiomeInfo.class) .getKey().equals(biomeKey))
.vanillaBiomeKey())
.filter(biomeKey::equals)
.findFirst() .findFirst()
.ifPresent(vanillaBiomeKey -> { .ifPresent(biome -> {
NamespacedKey vanillaBiomeKey = ((BukkitPlatformBiome) biome.getPlatformBiome()).getContext()
.get(BukkitBiomeInfo.class)
.vanillaBiomeKey();
switch(vanillaBiomeKey.toString()) { switch(vanillaBiomeKey.toString()) {
case "minecraft:snowy_taiga" -> wolf.setVariant(Variant.ASHEN); case "minecraft:snowy_taiga" -> wolf.setVariant(Variant.ASHEN);
case "minecraft:old_growth_pine_taiga" -> wolf.setVariant(Variant.BLACK); case "minecraft:old_growth_pine_taiga" -> wolf.setVariant(Variant.BLACK);