[API] Biome stuff rework
Shinoow opened this issue ยท 3 comments
An idea that popped up the other day is that some of my biome code could be handled a bit more efficient, to say the least. This is generally just biome class instances and wrappers to generalize a certain type of biome.
What I have in mind is adding interfaces for biome types (these types being IDarklandsBiome
and IDreadlandsBiome
due to those biomes having the most types). What this would do is you can simply reference theses interfaces through a instanceof call checking biome conditions for things. I myself would use these for checking if the player is inside a Darklands biome when triggering the blindness (there's another case here or two, but that one was the first one I could think of).
The second thing is that I would add a section to the API where I'd store references to my biomes (something like ACBiomes
, in contrast to ACBlocks
and ACItems
), allowing you to reference my biomes through the API, instead of forcing a hard dependency by calling them directly from my main class (or dig up paths to the biome classes and instantiate those).
This could be useful for @Team-RTG , so if any of you have input, feel free to comment!
Starting to think the initial mention didn't go through entirely, so I'll just do a bit of pinging here!
@whichonespink44 @topisani @srs-bsns
sounds great! not sure how we do it currently, but we gotta reimplement AC compat soon in 1.9 anyway, and this will probably be very helpful
Currently in 1.7.10, the main things we're using are ACBlocks to place Darkstone on cliff faces in AC biomes, and the AC biomes' topBlock and fillerBlock variables for surfacing.
However, a biome API would be most welcome because in order to grab the AC biomes, we're currently looping through all registered biomes on startup and checking to see which ones are AbyssalCraft biomes, which is fine for what we need (and we do it that way for all biome-adding mods that don't have a biome API (which is most of them)), but... it just feels a little hacky.