Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
package net.minecraftforge.common;
|
|
|
|
|
|
|
|
import java.util.*;
|
2013-09-05 14:08:02 +00:00
|
|
|
|
|
|
|
import cpw.mods.fml.common.FMLLog;
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
import net.minecraft.world.biome.*;
|
2013-09-05 14:08:02 +00:00
|
|
|
import net.minecraftforge.event.terraingen.DeferredBiomeDecorator;
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
import static net.minecraft.world.biome.BiomeGenBase.*;
|
|
|
|
import static net.minecraftforge.common.BiomeDictionary.Type.*;
|
|
|
|
|
|
|
|
public class BiomeDictionary
|
|
|
|
{
|
|
|
|
public enum Type
|
|
|
|
{
|
|
|
|
FOREST,
|
|
|
|
PLAINS,
|
|
|
|
MOUNTAIN,
|
|
|
|
HILLS,
|
|
|
|
SWAMP,
|
|
|
|
WATER,
|
|
|
|
DESERT,
|
|
|
|
FROZEN,
|
|
|
|
JUNGLE,
|
|
|
|
WASTELAND,
|
|
|
|
BEACH,
|
|
|
|
NETHER,
|
|
|
|
END,
|
|
|
|
MUSHROOM,
|
|
|
|
MAGICAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
private static final int BIOME_LIST_SIZE = 256;
|
|
|
|
private static BiomeInfo[] biomeList = new BiomeInfo[BIOME_LIST_SIZE];
|
2014-01-18 05:55:48 +00:00
|
|
|
@SuppressWarnings("unchecked")
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
private static ArrayList<BiomeGenBase>[] typeInfoList = new ArrayList[Type.values().length];
|
|
|
|
|
|
|
|
private static class BiomeInfo
|
|
|
|
{
|
|
|
|
public EnumSet<Type> typeList;
|
|
|
|
|
|
|
|
public BiomeInfo(Type[] types)
|
|
|
|
{
|
|
|
|
typeList = EnumSet.noneOf(Type.class);
|
|
|
|
for(Type t : types)
|
|
|
|
{
|
|
|
|
typeList.add(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
{
|
|
|
|
registerVanillaBiomes();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registers a biome with a specific biome type
|
|
|
|
*
|
|
|
|
* @param biome the biome to be registered
|
|
|
|
* @param type the type to register the biome as
|
|
|
|
* @return returns true if the biome was registered successfully
|
|
|
|
*/
|
|
|
|
public static boolean registerBiomeType(BiomeGenBase biome, Type ... types)
|
|
|
|
{
|
2013-12-13 07:32:36 +00:00
|
|
|
if(BiomeGenBase.func_150565_n()[biome.biomeID] != null)
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
{
|
|
|
|
for(Type type : types)
|
|
|
|
{
|
|
|
|
if(typeInfoList[type.ordinal()] == null)
|
|
|
|
{
|
|
|
|
typeInfoList[type.ordinal()] = new ArrayList<BiomeGenBase>();
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of biomes registered with a specific type
|
|
|
|
*
|
|
|
|
* @param type the Type to look for
|
|
|
|
* @return a list of biomes of the specified type, null if there are none
|
|
|
|
*/
|
|
|
|
public static BiomeGenBase[] getBiomesForType(Type type)
|
|
|
|
{
|
|
|
|
if(typeInfoList[type.ordinal()] != null)
|
|
|
|
{
|
2013-04-19 11:29:07 +00:00
|
|
|
return (BiomeGenBase[])typeInfoList[type.ordinal()].toArray(new BiomeGenBase[0]);
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return new BiomeGenBase[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of Types that a specific biome is registered with
|
|
|
|
*
|
|
|
|
* @param biome the biome to check
|
|
|
|
* @return the list of types, null if there are none
|
|
|
|
*/
|
|
|
|
public static Type[] getTypesForBiome(BiomeGenBase biome)
|
|
|
|
{
|
|
|
|
checkRegistration(biome);
|
|
|
|
|
|
|
|
if(biomeList[biome.biomeID] != null)
|
|
|
|
{
|
2013-04-19 11:08:53 +00:00
|
|
|
return (Type[])biomeList[biome.biomeID].typeList.toArray(new Type[0]);
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return new Type[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks to see if two biomes are registered as having the same type
|
|
|
|
*
|
|
|
|
* @param biomeA
|
|
|
|
* @param biomeB
|
|
|
|
* @return returns true if a common type is found, false otherwise
|
|
|
|
*/
|
|
|
|
public static boolean areBiomesEquivalent(BiomeGenBase biomeA, BiomeGenBase biomeB)
|
|
|
|
{
|
|
|
|
int a = biomeA.biomeID;
|
|
|
|
int b = biomeB.biomeID;
|
|
|
|
|
|
|
|
checkRegistration(biomeA);
|
|
|
|
checkRegistration(biomeB);
|
|
|
|
|
|
|
|
if(biomeList[a] != null && biomeList[b] != null)
|
|
|
|
{
|
|
|
|
for(Type type : biomeList[a].typeList)
|
|
|
|
{
|
|
|
|
if(containsType(biomeList[b], type))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks to see if the given biome is registered as being a specific type
|
|
|
|
*
|
|
|
|
* @param biome the biome to be considered
|
|
|
|
* @param type the type to check for
|
|
|
|
* @return returns true if the biome is registered as being of type type, false otherwise
|
|
|
|
*/
|
|
|
|
public static boolean isBiomeOfType(BiomeGenBase biome, Type type)
|
|
|
|
{
|
|
|
|
checkRegistration(biome);
|
|
|
|
|
|
|
|
if(biomeList[biome.biomeID] != null)
|
|
|
|
{
|
|
|
|
return containsType(biomeList[biome.biomeID], type);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks to see if the given biome has been registered as being of any type
|
|
|
|
* @param biome the biome to consider
|
|
|
|
* @return returns true if the biome has been registered, false otherwise
|
|
|
|
*/
|
|
|
|
public static boolean isBiomeRegistered(BiomeGenBase biome)
|
|
|
|
{
|
|
|
|
return biomeList[biome.biomeID] != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean isBiomeRegistered(int biomeID)
|
|
|
|
{
|
|
|
|
return biomeList[biomeID] != null;
|
|
|
|
}
|
|
|
|
|
2013-09-05 14:08:02 +00:00
|
|
|
public static void registerAllBiomes()
|
|
|
|
{
|
|
|
|
FMLLog.warning("Redundant call to BiomeDictionary.registerAllBiomes ignored");
|
|
|
|
}
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
/**
|
|
|
|
* Loops through the biome list and automatically adds tags to any biome that does not have any
|
2013-09-05 14:08:02 +00:00
|
|
|
* This is called by Forge at postinit time. It will additionally dispatch any deferred decorator
|
|
|
|
* creation events.
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
*
|
|
|
|
* DO NOT call this during world generation
|
|
|
|
*/
|
2013-09-05 14:08:02 +00:00
|
|
|
public static void registerAllBiomesAndGenerateEvents()
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
{
|
2013-12-13 07:32:36 +00:00
|
|
|
for(int i = 0; i < BiomeGenBase.func_150565_n().length; i++)
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
{
|
2013-12-13 07:32:36 +00:00
|
|
|
BiomeGenBase biome = BiomeGenBase.func_150565_n()[i];
|
2013-10-20 01:31:32 +00:00
|
|
|
|
|
|
|
if(biome == null)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2013-09-05 14:08:02 +00:00
|
|
|
if (biome.theBiomeDecorator instanceof DeferredBiomeDecorator)
|
|
|
|
{
|
|
|
|
DeferredBiomeDecorator decorator = (DeferredBiomeDecorator) biome.theBiomeDecorator;
|
2013-12-21 08:10:35 +00:00
|
|
|
decorator.fireCreateEventAndReplace(biome);
|
2013-09-05 14:08:02 +00:00
|
|
|
}
|
2013-10-20 01:31:32 +00:00
|
|
|
|
|
|
|
checkRegistration(biome);
|
Pulled Biome Tag System by Emasher, Closes #433
An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed.
A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it.
Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit.
2013-04-05 00:55:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Automatically looks for and registers a given biome with appropriate tags
|
|
|
|
* This method is called automatically if a biome has not been registered with any tags,
|
|
|
|
* And another method requests information about it
|
|
|
|
*
|
|
|
|
* NOTE: You can opt out of having your biome registered by registering it as type NULL
|
|
|
|
*
|
|
|
|
* @param biome the biome to be considered
|
|
|
|
*/
|
|
|
|
public static void makeBestGuess(BiomeGenBase biome)
|
|
|
|
{
|
|
|
|
if(biome.theBiomeDecorator.treesPerChunk >= 3)
|
|
|
|
{
|
|
|
|
if(biome.isHighHumidity() && biome.temperature >= 1.0F)
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, JUNGLE);
|
|
|
|
}
|
|
|
|
else if(!biome.isHighHumidity())
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, FOREST);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(biome.maxHeight <= 0.3F && biome.maxHeight >= 0.0F)
|
|
|
|
{
|
|
|
|
if(!biome.isHighHumidity() || biome.minHeight >= 0.0F)
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, PLAINS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(biome.isHighHumidity() && biome.minHeight < 0.0F && (biome.maxHeight <= 0.3F && biome.maxHeight >= 0.0F))
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, SWAMP);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(biome.minHeight <= -0.5F)
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, WATER);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(biome.maxHeight >= 1.5F)
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, MOUNTAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(biome.getEnableSnow() || biome.temperature < 0.2F)
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, FROZEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!biome.isHighHumidity() && biome.temperature >= 1.0F)
|
|
|
|
{
|
|
|
|
BiomeDictionary.registerBiomeType(biome, DESERT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Internal implementation
|
|
|
|
private static void checkRegistration(BiomeGenBase biome)
|
|
|
|
{
|
|
|
|
if(!isBiomeRegistered(biome))
|
|
|
|
{
|
|
|
|
makeBestGuess(biome);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private static boolean containsType(BiomeInfo info, Type type)
|
|
|
|
{
|
|
|
|
return info.typeList.contains(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void registerVanillaBiomes()
|
|
|
|
{
|
|
|
|
registerBiomeType(ocean, WATER );
|
|
|
|
registerBiomeType(plains, PLAINS );
|
|
|
|
registerBiomeType(desert, DESERT );
|
|
|
|
registerBiomeType(extremeHills, MOUNTAIN );
|
|
|
|
registerBiomeType(forest, FOREST );
|
|
|
|
registerBiomeType(taiga, FOREST, FROZEN);
|
|
|
|
registerBiomeType(taigaHills, FOREST, FROZEN);
|
|
|
|
registerBiomeType(swampland, SWAMP );
|
|
|
|
registerBiomeType(river, WATER );
|
|
|
|
registerBiomeType(frozenOcean, WATER, FROZEN);
|
|
|
|
registerBiomeType(frozenRiver, WATER, FROZEN);
|
|
|
|
registerBiomeType(icePlains, FROZEN );
|
|
|
|
registerBiomeType(iceMountains, FROZEN );
|
|
|
|
registerBiomeType(beach, BEACH );
|
|
|
|
registerBiomeType(desertHills, DESERT );
|
|
|
|
registerBiomeType(jungle, JUNGLE );
|
|
|
|
registerBiomeType(jungleHills, JUNGLE );
|
|
|
|
registerBiomeType(forestHills, FOREST );
|
|
|
|
registerBiomeType(sky, END );
|
|
|
|
registerBiomeType(hell, NETHER );
|
|
|
|
registerBiomeType(mushroomIsland, MUSHROOM );
|
|
|
|
registerBiomeType(extremeHillsEdge, MOUNTAIN );
|
|
|
|
registerBiomeType(mushroomIslandShore, MUSHROOM, BEACH);
|
|
|
|
}
|
2013-04-19 11:08:53 +00:00
|
|
|
}
|