From 48b82567d25f89c4e87ee4207f8dca7de06b4af0 Mon Sep 17 00:00:00 2001 From: Choonster Date: Fri, 20 Nov 2015 11:02:37 +1100 Subject: [PATCH] BiomeManager: Fix off-by-one errors --- src/main/java/net/minecraftforge/common/BiomeManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraftforge/common/BiomeManager.java b/src/main/java/net/minecraftforge/common/BiomeManager.java index 1b4517603..debdec98d 100644 --- a/src/main/java/net/minecraftforge/common/BiomeManager.java +++ b/src/main/java/net/minecraftforge/common/BiomeManager.java @@ -147,7 +147,7 @@ public class BiomeManager public static ImmutableList getBiomes(BiomeType type) { int idx = type.ordinal(); - List list = idx > biomes.length ? null : biomes[idx]; + List list = idx >= biomes.length ? null : biomes[idx]; return list != null ? ImmutableList.copyOf(list) : null; } @@ -179,7 +179,7 @@ public class BiomeManager if (ret.ordinal() >= biomes.length) { - biomes = Arrays.copyOf(biomes, ret.ordinal()); + biomes = Arrays.copyOf(biomes, ret.ordinal() + 1); } return ret;