Fixed invalid biome error

This commit is contained in:
boy0001 2015-03-21 01:01:35 +11:00
parent 1a3fe1426a
commit 5d91793395
2 changed files with 9 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<artifactId>PlotSquared</artifactId>
<version>2.8.11</version>
<version>2.8.12</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -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