From 5d917933953547357288085908916aae1ac99d11 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 21 Mar 2015 01:01:35 +1100 Subject: [PATCH] Fixed invalid biome error --- PlotSquared/pom.xml | 2 +- .../plot/util/bukkit/BukkitUtil.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/PlotSquared/pom.xml b/PlotSquared/pom.xml index b2d836294..aa18cace3 100644 --- a/PlotSquared/pom.xml +++ b/PlotSquared/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 2.8.11 + 2.8.12 PlotSquared jar diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java index b76150681..478d8502f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java @@ -242,11 +242,16 @@ public class BukkitUtil extends BlockManager { @Override public int getBiomeFromString(final String biomeStr) { - final Biome biome = Biome.valueOf(biomeStr.toUpperCase()); - if (biome == null) { + try { + final Biome biome = Biome.valueOf(biomeStr.toUpperCase()); + if (biome == null) { + return -1; + } + return Arrays.asList(Biome.values()).indexOf(biome); + } + catch (IllegalArgumentException e) { return -1; } - return Arrays.asList(Biome.values()).indexOf(biome); } @Override