From 09dd117d1d0f1d4cfdab84f24ad2b115a562d973 Mon Sep 17 00:00:00 2001 From: Azanor Date: Fri, 19 Apr 2013 14:08:53 +0300 Subject: [PATCH 1/2] Fix for ClassCastException when attempting to fetch Biome types from BiomeDictionary Attempting to fetch the BiomeDictionary types linked to a biome throws a ClassCastException. This fixes that --- common/net/minecraftforge/common/BiomeDictionary.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/net/minecraftforge/common/BiomeDictionary.java b/common/net/minecraftforge/common/BiomeDictionary.java index 3703a58255..8339b357f0 100644 --- a/common/net/minecraftforge/common/BiomeDictionary.java +++ b/common/net/minecraftforge/common/BiomeDictionary.java @@ -116,7 +116,7 @@ public class BiomeDictionary if(biomeList[biome.biomeID] != null) { - return (Type[])biomeList[biome.biomeID].typeList.toArray(); + return (Type[])biomeList[biome.biomeID].typeList.toArray(new Type[0]); } return new Type[0]; @@ -298,4 +298,4 @@ public class BiomeDictionary registerBiomeType(extremeHillsEdge, MOUNTAIN ); registerBiomeType(mushroomIslandShore, MUSHROOM, BEACH); } -} \ No newline at end of file +} From 4b2aca21249e3491ce2a99ab547e664852812256 Mon Sep 17 00:00:00 2001 From: Azanor Date: Fri, 19 Apr 2013 14:29:07 +0300 Subject: [PATCH 2/2] getBiomesForType will cause the same problem --- common/net/minecraftforge/common/BiomeDictionary.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/net/minecraftforge/common/BiomeDictionary.java b/common/net/minecraftforge/common/BiomeDictionary.java index 8339b357f0..d02a09cc14 100644 --- a/common/net/minecraftforge/common/BiomeDictionary.java +++ b/common/net/minecraftforge/common/BiomeDictionary.java @@ -98,7 +98,7 @@ public class BiomeDictionary { if(typeInfoList[type.ordinal()] != null) { - return (BiomeGenBase[])typeInfoList[type.ordinal()].toArray(); + return (BiomeGenBase[])typeInfoList[type.ordinal()].toArray(new BiomeGenBase[0]); } return new BiomeGenBase[0];