BiomeManager: Fix off-by-one errors
This commit is contained in:
parent
767d733948
commit
48b82567d2
1 changed files with 2 additions and 2 deletions
|
@ -147,7 +147,7 @@ public class BiomeManager
|
||||||
public static ImmutableList<BiomeEntry> getBiomes(BiomeType type)
|
public static ImmutableList<BiomeEntry> getBiomes(BiomeType type)
|
||||||
{
|
{
|
||||||
int idx = type.ordinal();
|
int idx = type.ordinal();
|
||||||
List<BiomeEntry> list = idx > biomes.length ? null : biomes[idx];
|
List<BiomeEntry> list = idx >= biomes.length ? null : biomes[idx];
|
||||||
|
|
||||||
return list != null ? ImmutableList.copyOf(list) : null;
|
return list != null ? ImmutableList.copyOf(list) : null;
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ public class BiomeManager
|
||||||
|
|
||||||
if (ret.ordinal() >= biomes.length)
|
if (ret.ordinal() >= biomes.length)
|
||||||
{
|
{
|
||||||
biomes = Arrays.copyOf(biomes, ret.ordinal());
|
biomes = Arrays.copyOf(biomes, ret.ordinal() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue