Search in sources :

Example 6 with BOPClimates

use of biomesoplenty.api.enums.BOPClimates in project BiomesOPlenty by Glitchfiend.

the class ModBiomes method registerBiome.

@Override
public IExtendedBiome registerBiome(IExtendedBiome extendedBiome, String idName) {
    if (extendedBiome == null)
        throw new IllegalArgumentException("Extended biome to register cannot be null!");
    // Add to the set of present biomes
    presentBiomes.add(extendedBiome.getBaseBiome());
    // Extra functionality builtin, such as with BOPBiome
    if (extendedBiome instanceof Biome) {
        for (Entry<BOPClimates, Integer> entry : extendedBiome.getWeightMap().entrySet()) {
            if (entry != null) {
                BOPClimates climate = entry.getKey();
                int weight = entry.getValue();
                climate.addBiome(weight, extendedBiome.getBaseBiome());
            }
        }
    } else // extendedBiome is a wrapper
    {
        biomeWrapperMap.put(Biome.getIdForBiome(extendedBiome.getBaseBiome()), extendedBiome);
    }
    return extendedBiome;
}
Also used : BOPOverworldBiome(biomesoplenty.common.biome.overworld.BOPOverworldBiome) IExtendedBiome(biomesoplenty.api.biome.IExtendedBiome) BOPHellBiome(biomesoplenty.common.biome.nether.BOPHellBiome) Biome(net.minecraft.world.biome.Biome) BOPClimates(biomesoplenty.api.enums.BOPClimates)

Aggregations

BOPClimates (biomesoplenty.api.enums.BOPClimates)6 IExtendedBiome (biomesoplenty.api.biome.IExtendedBiome)4 Biome (net.minecraft.world.biome.Biome)3 WeightedBiomeEntry (biomesoplenty.api.enums.BOPClimates.WeightedBiomeEntry)2 IConfigObj (biomesoplenty.api.config.IConfigObj)1 GeneratorStage (biomesoplenty.api.generation.GeneratorStage)1 IGenerationManager (biomesoplenty.api.generation.IGenerationManager)1 IGenerator (biomesoplenty.api.generation.IGenerator)1 BOPHellBiome (biomesoplenty.common.biome.nether.BOPHellBiome)1 BOPOverworldBiome (biomesoplenty.common.biome.overworld.BOPOverworldBiome)1 Gson (com.google.gson.Gson)1 JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 JsonPrimitive (com.google.gson.JsonPrimitive)1 Iterator (java.util.Iterator)1 List (java.util.List)1 EnumCreatureType (net.minecraft.entity.EnumCreatureType)1 ResourceLocation (net.minecraft.util.ResourceLocation)1