Posted December 27, 201410 yr I was looking to differentiate between Ocean and Deep Ocean by assigning a new biome Type to BiomeGenBase.deepOcean by using the following code snippet: Type deepOcean = BiomeDictionary.Type.getType("DEEP OCEAN"); BiomeDictionary.registerBiomeType(BiomeGenBase.deepOcean, deepOcean); However, I get this error: java.lang.ArrayIndexOutOfBoundsException: 31 at net.minecraftforge.common.BiomeDictionary.registerBiomeType(BiomeDictionary.java:152) ... It's like array to store the biome types isn't being resized. Anyone know the way to do this?
December 28, 201410 yr Author So apparently, if I'm reading the code correctly, you can not add new BiomeDictionary.Type's as there is a private list whose length is set. private static ArrayList[] typeInfoList = new ArrayList[Type.values().length]; That length is not updated when calling registerBiomeType. public static boolean registerBiomeType(BiomeGenBase biome, Type ... types) { types = listSubTags(types); if(BiomeGenBase.getBiomeGenArray()[biome.biomeID] != null) { for(Type type : types) { if(typeInfoList[type.ordinal()] == null) { typeInfoList[type.ordinal()] = new ArrayList(); } typeInfoList[type.ordinal()].add(biome); } if(biomeList[biome.biomeID] == null) { biomeList[biome.biomeID] = new BiomeInfo(types); } else { for(Type type : types) { biomeList[biome.biomeID].typeList.add(type); } } return true; } return false; } My code in the first post fails at: typeInfoList[type.ordinal()].add(biome); So, my thought was to extend the BiomeDictionary and override this method to work properly, but I didn't know if it then would still work with other mods that register new biomes?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.