2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2018-07-01 21:17:28 +00:00
|
|
|
* Copyright (c) 2016-2018.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
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.*;
|
2017-06-27 21:04:51 +00:00
|
|
|
import java.util.stream.Collectors;
|
2013-09-05 14:08:02 +00:00
|
|
|
|
2016-11-30 23:48:44 +00:00
|
|
|
import javax.annotation.Nonnull;
|
2018-09-12 01:25:25 +00:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
2016-04-09 23:03:46 +00:00
|
|
|
|
|
|
|
import net.minecraft.init.Biomes;
|
2016-03-03 07:07:18 +00:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
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.*;
|
|
|
|
import static net.minecraftforge.common.BiomeDictionary.Type.*;
|
2018-09-06 11:39:01 +00:00
|
|
|
import net.minecraftforge.registries.ForgeRegistries;
|
2016-11-30 23:48:44 +00:00
|
|
|
|
|
|
|
import com.google.common.base.Preconditions;
|
|
|
|
import com.google.common.collect.ImmutableList;
|
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
|
|
|
|
|
|
|
public class BiomeDictionary
|
|
|
|
{
|
2017-06-27 21:04:51 +00:00
|
|
|
private static final boolean DEBUG = false;
|
2018-09-12 01:25:25 +00:00
|
|
|
private static final Logger LOGGER = LogManager.getLogger();
|
2017-06-27 21:04:51 +00:00
|
|
|
|
2016-11-30 23:48:44 +00:00
|
|
|
public static final class Type
|
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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
|
|
|
|
private static final Map<String, Type> byName = new HashMap<String, Type>();
|
2018-04-01 08:03:27 +00:00
|
|
|
private static Collection<Type> allTypes = Collections.unmodifiableCollection(byName.values());
|
2016-11-30 23:48:44 +00:00
|
|
|
|
2014-07-01 02:46:00 +00:00
|
|
|
/*Temperature-based tags. Specifying neither implies a biome is temperate*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static final Type HOT = new Type("HOT");
|
|
|
|
public static final Type COLD = new Type("COLD");
|
|
|
|
|
2014-07-01 02:46:00 +00:00
|
|
|
/*Tags specifying the amount of vegetation a biome has. Specifying neither implies a biome to have moderate amounts*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static final Type SPARSE = new Type("SPARSE");
|
|
|
|
public static final Type DENSE = new Type("DENSE");
|
|
|
|
|
2014-07-01 02:46:00 +00:00
|
|
|
/*Tags specifying how moist a biome is. Specifying neither implies the biome as having moderate humidity*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static final Type WET = new Type("WET");
|
|
|
|
public static final Type DRY = new Type("DRY");
|
|
|
|
|
2014-07-01 02:46:00 +00:00
|
|
|
/*Tree-based tags, SAVANNA refers to dry, desert-like trees (Such as Acacia), CONIFEROUS refers to snowy trees (Such as Spruce) and JUNGLE refers to jungle trees.
|
|
|
|
* Specifying no tag implies a biome has temperate trees (Such as Oak)*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static final Type SAVANNA = new Type("SAVANNA");
|
|
|
|
public static final Type CONIFEROUS = new Type("CONIFEROUS");
|
|
|
|
public static final Type JUNGLE = new Type("JUNGLE");
|
2014-07-08 04:29:37 +00:00
|
|
|
|
2014-07-01 02:46:00 +00:00
|
|
|
/*Tags specifying the nature of a biome*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static final Type SPOOKY = new Type("SPOOKY");
|
|
|
|
public static final Type DEAD = new Type("DEAD");
|
|
|
|
public static final Type LUSH = new Type("LUSH");
|
|
|
|
public static final Type NETHER = new Type("NETHER");
|
|
|
|
public static final Type END = new Type("END");
|
|
|
|
public static final Type MUSHROOM = new Type("MUSHROOM");
|
|
|
|
public static final Type MAGICAL = new Type("MAGICAL");
|
2016-12-03 18:46:36 +00:00
|
|
|
public static final Type RARE = new Type("RARE");
|
2016-11-30 23:48:44 +00:00
|
|
|
|
|
|
|
public static final Type OCEAN = new Type("OCEAN");
|
|
|
|
public static final Type RIVER = new Type("RIVER");
|
|
|
|
/**
|
|
|
|
* A general tag for all water-based biomes. Shown as present if OCEAN or RIVER are.
|
|
|
|
**/
|
|
|
|
public static final Type WATER = new Type("WATER", OCEAN, RIVER);
|
2014-07-08 04:29:37 +00:00
|
|
|
|
2014-07-01 02:46:00 +00:00
|
|
|
/*Generic types which a biome can be*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static final Type MESA = new Type("MESA");
|
|
|
|
public static final Type FOREST = new Type("FOREST");
|
|
|
|
public static final Type PLAINS = new Type("PLAINS");
|
|
|
|
public static final Type MOUNTAIN = new Type("MOUNTAIN");
|
|
|
|
public static final Type HILLS = new Type("HILLS");
|
|
|
|
public static final Type SWAMP = new Type("SWAMP");
|
|
|
|
public static final Type SANDY = new Type("SANDY");
|
|
|
|
public static final Type SNOWY = new Type("SNOWY");
|
|
|
|
public static final Type WASTELAND = new Type("WASTELAND");
|
|
|
|
public static final Type BEACH = new Type("BEACH");
|
2016-12-03 18:46:36 +00:00
|
|
|
public static final Type VOID = new Type("VOID");
|
2016-11-30 23:48:44 +00:00
|
|
|
|
|
|
|
private final String name;
|
|
|
|
private final List<Type> subTypes;
|
|
|
|
private final Set<Biome> biomes = new HashSet<Biome>();
|
|
|
|
private final Set<Biome> biomesUn = Collections.unmodifiableSet(biomes);
|
|
|
|
|
|
|
|
private Type(String name, Type... subTypes)
|
|
|
|
{
|
|
|
|
this.name = name;
|
|
|
|
this.subTypes = ImmutableList.copyOf(subTypes);
|
|
|
|
|
|
|
|
byName.put(name, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the name for this type.
|
|
|
|
*/
|
|
|
|
public String getName()
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
return name;
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
2014-07-08 04:29:37 +00:00
|
|
|
|
2016-11-30 23:48:44 +00:00
|
|
|
public String toString()
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
return name;
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
2014-07-08 04:29:37 +00:00
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Retrieves a Type instance by name,
|
2014-07-08 04:29:37 +00:00
|
|
|
* if one does not exist already it creates one.
|
2016-03-23 14:34:48 +00:00
|
|
|
* This can be used as intermediate measure for modders to
|
2016-11-30 23:48:44 +00:00
|
|
|
* add their own Biome types.
|
|
|
|
* <p>
|
|
|
|
* There are <i>no</i> naming conventions besides:
|
|
|
|
* <ul><li><b>Must</b> be all upper case (enforced by name.toUpper())</li>
|
|
|
|
* <li><b>No</b> Special characters. {Unenforced, just don't be a pain, if it becomes a issue I WILL
|
|
|
|
* make this RTE with no worry about backwards compatibility}</li></ul>
|
|
|
|
* <p>
|
2014-07-08 04:29:37 +00:00
|
|
|
* Note: For performance sake, the return value of this function SHOULD be cached.
|
|
|
|
* Two calls with the same name SHOULD return the same value.
|
|
|
|
*
|
|
|
|
* @param name The name of this Type
|
|
|
|
* @return An instance of Type for this name.
|
|
|
|
*/
|
|
|
|
public static Type getType(String name, Type... subTypes)
|
|
|
|
{
|
|
|
|
name = name.toUpperCase();
|
2016-11-30 23:48:44 +00:00
|
|
|
Type t = byName.get(name);
|
|
|
|
if (t == null)
|
2015-06-13 00:08:19 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
t = new Type(name, subTypes);
|
2014-08-15 03:33:23 +00:00
|
|
|
}
|
2016-11-30 23:48:44 +00:00
|
|
|
return t;
|
2014-07-08 04:29:37 +00:00
|
|
|
}
|
2018-09-12 01:25:25 +00:00
|
|
|
|
2018-04-01 08:03:27 +00:00
|
|
|
/**
|
|
|
|
* @return An unmodifiable collection of all current biome types.
|
|
|
|
*/
|
|
|
|
public static Collection<Type> getAll()
|
|
|
|
{
|
|
|
|
return allTypes;
|
|
|
|
}
|
2018-09-12 01:25:25 +00:00
|
|
|
|
|
|
|
@Nullable
|
|
|
|
public static Type fromVanilla(Biome.Category category)
|
|
|
|
{
|
|
|
|
if (category == Biome.Category.NONE)
|
|
|
|
return null;
|
|
|
|
if (category == Biome.Category.THEEND)
|
|
|
|
return VOID;
|
|
|
|
return getType(category.name());
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2016-11-30 23:48:44 +00:00
|
|
|
private static final Map<ResourceLocation, BiomeInfo> biomeInfoMap = new HashMap<ResourceLocation, BiomeInfo>();
|
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 class BiomeInfo
|
|
|
|
{
|
|
|
|
|
2016-11-30 23:48:44 +00:00
|
|
|
private final Set<Type> types = new HashSet<Type>();
|
|
|
|
private final Set<Type> typesUn = Collections.unmodifiableSet(this.types);
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
{
|
|
|
|
registerVanillaBiomes();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Adds the given types to the biome.
|
2014-07-08 04:29:37 +00:00
|
|
|
*
|
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
|
|
|
*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static void addTypes(Biome biome, Type... types)
|
2014-07-08 04:29:37 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
Preconditions.checkArgument(ForgeRegistries.BIOMES.containsValue(biome), "Cannot add types to unregistered biome %s", 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
|
|
|
|
2017-02-04 17:29:42 +00:00
|
|
|
Collection<Type> supertypes = listSupertypes(types);
|
2017-06-27 21:04:51 +00:00
|
|
|
Collections.addAll(supertypes, types);
|
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
|
|
|
|
2017-02-04 17:29:42 +00:00
|
|
|
for (Type type : supertypes)
|
2016-11-30 23:48:44 +00:00
|
|
|
{
|
|
|
|
type.biomes.add(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
|
|
|
}
|
|
|
|
|
2017-02-05 17:47:07 +00:00
|
|
|
BiomeInfo biomeInfo = getBiomeInfo(biome);
|
|
|
|
Collections.addAll(biomeInfo.types, types);
|
|
|
|
biomeInfo.types.addAll(supertypes);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Gets the set of biomes that have the given type.
|
2014-07-08 04:29:37 +00:00
|
|
|
*
|
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
|
|
|
*/
|
2016-11-30 23:48:44 +00:00
|
|
|
@Nonnull
|
|
|
|
public static Set<Biome> getBiomes(Type type)
|
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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
return type.biomesUn;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Gets the set of types that have been added to the given biome.
|
2014-07-08 04:29:37 +00:00
|
|
|
*
|
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
|
|
|
*/
|
2016-11-30 23:48:44 +00:00
|
|
|
@Nonnull
|
|
|
|
public static Set<Type> getTypes(Biome 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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
ensureHasTypes(biome);
|
|
|
|
return getBiomeInfo(biome).typesUn;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Checks if the two given biomes have types in common.
|
2014-07-08 04:29:37 +00:00
|
|
|
*
|
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 returns true if a common type is found, false otherwise
|
|
|
|
*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static boolean areSimilar(Biome biomeA, Biome biomeB)
|
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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
for (Type type : getTypes(biomeA))
|
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
|
|
|
{
|
2017-02-04 17:29:42 +00:00
|
|
|
if (getTypes(biomeB).contains(type))
|
2016-05-18 10:29:10 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
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 false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Checks if the given type has been added to the given biome.
|
2014-07-08 04:29:37 +00:00
|
|
|
*
|
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
|
|
|
*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static boolean hasType(Biome biome, Type type)
|
2014-07-08 04:29:37 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
return getTypes(biome).contains(type);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Checks if any type has been added to the given biome.
|
2014-07-08 04:29:37 +00:00
|
|
|
*
|
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
|
|
|
*/
|
2016-11-30 23:48:44 +00:00
|
|
|
public static boolean hasAnyType(Biome 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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
return !getBiomeInfo(biome).types.isEmpty();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-30 23:48:44 +00:00
|
|
|
* Automatically adds appropriate types to a given biome based on certain heuristics.
|
|
|
|
* If a biome's types are requested and no types have been added to the biome so far, the biome's types
|
|
|
|
* will be determined and added using this method.
|
2014-07-08 04:29:37 +00:00
|
|
|
*
|
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
|
|
|
*/
|
2016-05-18 10:29:10 +00:00
|
|
|
public static void makeBestGuess(Biome biome)
|
2014-07-08 04:29:37 +00:00
|
|
|
{
|
2018-09-22 10:40:22 +00:00
|
|
|
Type type = Type.fromVanilla(biome.getCategory());
|
2018-09-12 01:25:25 +00:00
|
|
|
if (type != 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
|
|
|
{
|
2018-09-12 01:25:25 +00:00
|
|
|
BiomeDictionary.addTypes(biome, type);
|
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
|
|
|
}
|
|
|
|
|
2018-09-22 10:40:22 +00:00
|
|
|
if (biome.getDownfall() > 0.85f)
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, WET);
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
|
|
|
|
2018-09-22 10:40:22 +00:00
|
|
|
if (biome.getDownfall() < 0.15f)
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, DRY);
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
|
|
|
|
2017-10-04 05:08:36 +00:00
|
|
|
if (biome.getDefaultTemperature() > 0.85f)
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, HOT);
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
|
|
|
|
2017-10-04 05:08:36 +00:00
|
|
|
if (biome.getDefaultTemperature() < 0.15f)
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, COLD);
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
|
|
|
|
2018-09-22 10:40:22 +00:00
|
|
|
if (biome.isHighHumidity() && biome.getDepth() < 0.0F && (biome.getScale() <= 0.3F && biome.getScale() >= 0.0F))
|
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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, SWAMP);
|
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
|
|
|
}
|
|
|
|
|
2018-09-22 10:40:22 +00:00
|
|
|
if (biome.getDepth() <= -0.5F)
|
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
|
|
|
{
|
2018-09-22 10:40:22 +00:00
|
|
|
if (biome.getScale() == 0.0F)
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, RIVER);
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, OCEAN);
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2018-09-22 10:40:22 +00:00
|
|
|
if (biome.getScale() >= 0.4F && biome.getScale() < 1.5F)
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, HILLS);
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
|
|
|
|
2018-09-22 10:40:22 +00:00
|
|
|
if (biome.getScale() >= 1.5F)
|
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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
BiomeDictionary.addTypes(biome, MOUNTAIN);
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-08 04:29:37 +00:00
|
|
|
//Internal implementation
|
2016-05-18 10:29:10 +00:00
|
|
|
private static BiomeInfo getBiomeInfo(Biome biome)
|
2016-03-03 07:07:18 +00:00
|
|
|
{
|
2017-06-28 07:14:10 +00:00
|
|
|
return biomeInfoMap.computeIfAbsent(biome.getRegistryName(), k -> new BiomeInfo());
|
2016-03-03 07:07:18 +00:00
|
|
|
}
|
2016-05-18 10:29:10 +00:00
|
|
|
|
2016-11-30 23:48:44 +00:00
|
|
|
/**
|
|
|
|
* Ensure that at least one type has been added to the given biome.
|
|
|
|
*/
|
|
|
|
static void ensureHasTypes(Biome 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
|
|
|
{
|
2016-11-30 23:48:44 +00:00
|
|
|
if (!hasAnyType(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
|
|
|
{
|
|
|
|
makeBestGuess(biome);
|
2018-09-12 01:25:25 +00:00
|
|
|
LOGGER.warn("No types have been added to Biome {}, types have been assigned on a best-effort guess: {}", biome.getRegistryName(), getTypes(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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-04 17:29:42 +00:00
|
|
|
private static Collection<Type> listSupertypes(Type... types)
|
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
|
|
|
{
|
2017-02-04 17:29:42 +00:00
|
|
|
Set<Type> supertypes = new HashSet<Type>();
|
|
|
|
Deque<Type> next = new ArrayDeque<Type>();
|
|
|
|
Collections.addAll(next, types);
|
2014-07-08 04:29:37 +00:00
|
|
|
|
2017-02-04 17:29:42 +00:00
|
|
|
while (!next.isEmpty())
|
2014-07-01 02:46:00 +00:00
|
|
|
{
|
2017-02-04 17:29:42 +00:00
|
|
|
Type type = next.remove();
|
|
|
|
|
|
|
|
for (Type sType : Type.byName.values())
|
2016-11-30 23:48:44 +00:00
|
|
|
{
|
2017-06-27 21:04:51 +00:00
|
|
|
if (sType.subTypes.contains(type) && supertypes.add(sType))
|
2017-02-04 17:29:42 +00:00
|
|
|
next.add(sType);
|
2016-11-30 23:48:44 +00:00
|
|
|
}
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
2014-07-08 04:29:37 +00:00
|
|
|
|
2017-02-04 17:29:42 +00:00
|
|
|
return supertypes;
|
2014-07-01 02:46:00 +00:00
|
|
|
}
|
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 void registerVanillaBiomes()
|
|
|
|
{
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.OCEAN, OCEAN );
|
|
|
|
addTypes(Biomes.PLAINS, PLAINS );
|
|
|
|
addTypes(Biomes.DESERT, HOT, DRY, SANDY );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.FOREST, FOREST );
|
|
|
|
addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.SWAMP, WET, SWAMP );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.RIVER, RIVER );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.NETHER, HOT, DRY, NETHER );
|
|
|
|
addTypes(Biomes.THE_END, COLD, DRY, END );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY );
|
|
|
|
addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND );
|
|
|
|
addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
|
|
|
|
addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE );
|
|
|
|
addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.BEACH, BEACH );
|
|
|
|
addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.WOODED_HILLS, FOREST, HILLS );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE );
|
|
|
|
addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS );
|
|
|
|
addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE );
|
|
|
|
addTypes(Biomes.DEEP_OCEAN, OCEAN );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.STONE_SHORE, BEACH );
|
|
|
|
addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.BIRCH_FOREST, FOREST );
|
|
|
|
addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST );
|
|
|
|
addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
|
|
|
|
addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS );
|
|
|
|
addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST );
|
|
|
|
addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
|
|
|
addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE );
|
2016-12-03 18:46:36 +00:00
|
|
|
addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE );
|
|
|
|
addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE );
|
2018-09-22 10:40:22 +00:00
|
|
|
addTypes(Biomes.BADLANDS, MESA, SANDY );
|
|
|
|
addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SPARSE, SANDY );
|
|
|
|
addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY );
|
|
|
|
addTypes(Biomes.SMALL_END_ISLANDS, END );
|
|
|
|
addTypes(Biomes.END_MIDLANDS, END );
|
|
|
|
addTypes(Biomes.END_HIGHLANDS, END );
|
|
|
|
addTypes(Biomes.END_BARRENS, END );
|
|
|
|
addTypes(Biomes.WARM_OCEAN, OCEAN, HOT );
|
|
|
|
addTypes(Biomes.LUKEWARM_OCEAN, OCEAN );
|
|
|
|
addTypes(Biomes.COLD_OCEAN, OCEAN, COLD );
|
|
|
|
addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT );
|
|
|
|
addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN );
|
|
|
|
addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD );
|
|
|
|
addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD );
|
|
|
|
addTypes(Biomes.THE_VOID, VOID );
|
|
|
|
addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE );
|
|
|
|
addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE );
|
|
|
|
addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
|
|
|
|
addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE );
|
|
|
|
addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE );
|
|
|
|
addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE );
|
|
|
|
addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE );
|
|
|
|
addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
|
|
|
|
addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE );
|
|
|
|
addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE );
|
|
|
|
addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE );
|
|
|
|
addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE );
|
|
|
|
addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
|
|
|
|
addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE );
|
|
|
|
addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE );
|
|
|
|
addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
|
|
|
|
addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
|
|
|
addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
|
|
|
|
addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
|
|
|
addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE );
|
|
|
|
addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
2017-06-27 21:04:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (DEBUG)
|
|
|
|
{
|
2018-09-12 01:25:25 +00:00
|
|
|
StringBuilder buf = new StringBuilder();
|
|
|
|
buf.append("BiomeDictionary:\n");
|
|
|
|
Type.byName.forEach((name, type) -> buf.append(" ").append(type.name).append(": ").append(type.biomes.stream().map(b -> b.getRegistryName().toString()).collect(Collectors.joining(", "))).append('\n'));
|
|
|
|
LOGGER.debug(buf.toString());
|
2017-06-27 21:04:51 +00:00
|
|
|
}
|
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-04-19 11:08:53 +00:00
|
|
|
}
|