Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.