From 84fbb8ae1cd4e068556b7f1badb86d8f0cfe5772 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 18 Jul 2020 07:51:55 -0700 Subject: [PATCH] Fixes backwards compatibility with 1.15.2 Fixes https://github.com/BentoBoxWorld/SkyGrid/issues/44 --- .../bentobox/skygrid/generators/WorldStyles.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/world/bentobox/skygrid/generators/WorldStyles.java b/src/main/java/world/bentobox/skygrid/generators/WorldStyles.java index 69af2cc..9340a61 100644 --- a/src/main/java/world/bentobox/skygrid/generators/WorldStyles.java +++ b/src/main/java/world/bentobox/skygrid/generators/WorldStyles.java @@ -11,6 +11,8 @@ import org.bukkit.World; import org.bukkit.entity.EntityType; +import com.google.common.base.Enums; + import world.bentobox.skygrid.SkyGrid; @@ -186,13 +188,15 @@ private TreeMap netherSpawns() { s.put(50, EntityType.MAGMA_CUBE); s.put(75, EntityType.SKELETON); s.put(100, EntityType.WITHER_SKELETON); - s.put(125, EntityType.ZOMBIFIED_PIGLIN); s.put(150, EntityType.SKELETON_HORSE); - s.put(50, EntityType.STRIDER); - s.put(125, EntityType.PIGLIN); - s.put(125, EntityType.ZOGLIN); - s.put(125, EntityType.HOGLIN); s.put(25, EntityType.ENDERMAN); + if (Enums.getIfPresent(EntityType.class, "ZOMBIFIED_PIGLIN").isPresent()) { + s.put(125, EntityType.ZOMBIFIED_PIGLIN); + s.put(50, EntityType.STRIDER); + s.put(125, EntityType.PIGLIN); + s.put(125, EntityType.ZOGLIN); + s.put(125, EntityType.HOGLIN); + } return s; }