mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-27 12:35:12 +01:00
Fixes CompatibleBiome#isCompatible
and #getBiome
`#isCompatible` always returned true and `#getBiome` could result in an Exception because of biomes not having any version information configured (silencing it should not be the way to go but Minecraft 1.18 updates \o/)
This commit is contained in:
parent
7f055c4391
commit
070f1adee7
@ -170,10 +170,7 @@ public enum CompatibleBiome {
|
||||
}
|
||||
|
||||
public boolean isCompatible() {
|
||||
Version version = versions.getLast();
|
||||
ServerVersion.isServerVersionAtLeast(version.version);
|
||||
|
||||
return true;
|
||||
return getBiome() != null;
|
||||
}
|
||||
|
||||
public List<Version> getVersions() {
|
||||
@ -181,10 +178,13 @@ public enum CompatibleBiome {
|
||||
}
|
||||
|
||||
public Biome getBiome() {
|
||||
for (Version version : versions) {
|
||||
if (ServerVersion.isServerVersionAtLeast(version.version)) {
|
||||
return Biome.valueOf(version.biome);
|
||||
try {
|
||||
for (Version version : versions) {
|
||||
if (ServerVersion.isServerVersionAtLeast(version.version)) {
|
||||
return Biome.valueOf(version.biome);
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException ignore) { // This means the supporter biome server version is wrongly configured
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user