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> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<artifactId>PlotSquared</artifactId> <artifactId>PlotSquared</artifactId>
<version>2.8.11</version> <version>2.8.12</version>
<name>PlotSquared</name> <name>PlotSquared</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>

View File

@ -242,11 +242,16 @@ public class BukkitUtil extends BlockManager {
@Override @Override
public int getBiomeFromString(final String biomeStr) { public int getBiomeFromString(final String biomeStr) {
final Biome biome = Biome.valueOf(biomeStr.toUpperCase()); try {
if (biome == null) { 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 -1;
} }
return Arrays.asList(Biome.values()).indexOf(biome);
} }
@Override @Override