Guest Posted March 10, 2017 Posted March 10, 2017 I am updating a mod from 1.7.10 to 1.11, and I have a quick question. This line in the mod is tripping me up: BiomeGenBase[] biomeArray = BiomeGenBase.getBiomeGenArray(); Was BiomeGenBase replaced with Biome or something else? That's what I thought, but there isn't a getBiomeGenArray or something similar method in it.What would I use instead? I found that there was a Biomes class that had all the vanilla biomes, and it crossed my mind that I could put all these into an array. But that wouldn't work if there was modded biomes. Any help is appreciated. Quote
Matryoshika Posted March 10, 2017 Posted March 10, 2017 Well, looking up what BiomeGenBase#getBiomeGenArray did, it returns an array of all biomes, indexed by biome id. I believe there is a simpler way of doing it, but cannot remember what it was, but in any case, you should be able to iterate over the REGISTRY field in the Biome class or, simpler, just call Biome#getBiomeForId, from 0 through 255 (max value in the underlying IntIdentityHashBiMap) and add each non-null biomes to your own array. Quote Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
Draco18s Posted March 10, 2017 Posted March 10, 2017 The Biome REGISTRY field would be better, probably. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Guest Posted March 10, 2017 Posted March 10, 2017 I have another question. How would I get the modid of the mod (or vanilla minecraft) that registered the biome? The mod I'm updating used this code, but I'm not sure if that's a good approach or not. Quote
Recommended Posts
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.