Search in sources :

Example 1 with Biome

use of net.minecraft.world.biome.Biome in project MinecraftForge by MinecraftForge.

the class EntityRegistry method addSpawn.

/**
     * Add a spawn entry for the supplied entity in the supplied {@link Biome} list
     * @param entityClass Entity class added
     * @param weightedProb Probability
     * @param min Min spawn count
     * @param max Max spawn count
     * @param typeOfCreature Type of spawn
     * @param biomes List of biomes
     */
public static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, Biome... biomes) {
    for (Biome biome : biomes) {
        List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature);
        boolean found = false;
        for (SpawnListEntry entry : spawns) {
            //Adjusting an existing spawn entry
            if (entry.entityClass == entityClass) {
                entry.itemWeight = weightedProb;
                entry.minGroupCount = min;
                entry.maxGroupCount = max;
                found = true;
                break;
            }
        }
        if (!found)
            spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
    }
}
Also used : Biome(net.minecraft.world.biome.Biome) SpawnListEntry(net.minecraft.world.biome.Biome.SpawnListEntry)

Example 2 with Biome

use of net.minecraft.world.biome.Biome in project Realistic-Terrain-Generation by Team-RTG.

the class RealisticBiomeBYGBase method addBiomes.

public static void addBiomes() {
    if (Loader.isModLoaded("BiomesYouGo")) {
        for (Biome biome : Biome.REGISTRY) {
            if (biome.getBiomeName().isEmpty()) {
                Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome));
                continue;
            }
            String biomeName = biome.getBiomeName();
            String biomeClass = biome.getBiomeClass().getName();
            if (biomeName.equals("autumnForest") && biomeClass.equals("mod.mcreator.mcreator_autumnForest$BiomeGenautumnForest")) {
                bygAutumnForest = new RealisticBiomeBYGAutumnForest(biome);
            } else if (biomeName.equals("birchPlains") && biomeClass.equals("mod.mcreator.mcreator_birchPlains$BiomeGenbirchPlains")) {
                bygLushForest = new RealisticBiomeBYGLushForest(biome);
            } else if (biomeName.equals("redRockMoutains") && biomeClass.equals("mod.mcreator.mcreator_redRockMoutains$BiomeGenredRockMoutains")) {
                bygRedRockMountains = new RealisticBiomeBYGRedRockMountains(biome);
            } else if (biomeName.equals("redDesert") && biomeClass.equals("mod.mcreator.mcreator_redDesert$BiomeGenredDesert")) {
                bygRedDesert = new RealisticBiomeBYGRedDesert(biome);
            } else if (biomeName.equals("willowSwamps") && biomeClass.equals("mod.mcreator.mcreator_willowSwamps$BiomeGenwillowSwamps")) {
                bygWillowSwamps = new RealisticBiomeBYGWillowSwamps(biome);
            } else if (biomeName.equals("birchPlains1") && biomeClass.equals("mod.mcreator.mcreator_birchPlains1$BiomeGenbirchPlains1")) {
                bygBirchPlains = new RealisticBiomeBYGBirchPlains(biome);
            } else if (biomeName.equals("tundra") && biomeClass.equals("mod.mcreator.mcreator_tundra$BiomeGentundra")) {
                bygFrozenTundra = new RealisticBiomeBYGFrozenTundra(biome);
            } else if (biomeName.equals("athuraForest") && biomeClass.equals("mod.mcreator.mcreator_athuraForest$BiomeGenathuraForest")) {
                bygFrozenTundra = new RealisticBiomeBYGAthuraForest(biome);
            } else if (biomeName.equals("mushroomMoutains") && biomeClass.equals("mod.mcreator.mcreator_mushroomMoutains$BiomeGenmushroomMoutains")) {
                bygFrozenTundra = new RealisticBiomeBYGMushroomMountains(biome);
            } else if (biomeName.equals("shrubs") && biomeClass.equals("mod.mcreator.mcreator_shrubs$BiomeGenshrubs")) {
                bygFrozenTundra = new RealisticBiomeBYGShrubs(biome);
            }
        }
    }
}
Also used : Biome(net.minecraft.world.biome.Biome)

Example 3 with Biome

use of net.minecraft.world.biome.Biome in project Realistic-Terrain-Generation by Team-RTG.

the class RealisticBiomeJIKBase method addBiomes.

public static void addBiomes() {
    if (Loader.isModLoaded("Jikou")) {
        for (Biome biome : Biome.REGISTRY) {
            if (biome.getBiomeName().isEmpty()) {
                Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome));
                continue;
            }
            String biomeName = biome.getBiomeName();
            String biomeClass = biome.getBiomeClass().getName();
            if (biomeName.equals("jikou") && biomeClass.equals("mod.mcreator.mcreator_jikou$BiomeGenjikou")) {
                jikJikou = new RealisticBiomeJIKJikou(biome);
            } else if (biomeName.equals("cherry") && biomeClass.equals("mod.mcreator.mcreator_cherry$BiomeGencherry")) {
                jikCherry = new RealisticBiomeJIKCherry(biome);
            }
        }
    }
}
Also used : Biome(net.minecraft.world.biome.Biome)

Example 4 with Biome

use of net.minecraft.world.biome.Biome in project Realistic-Terrain-Generation by Team-RTG.

the class RealisticBiomeIAFBase method addBiomes.

public static void addBiomes() {
    if (Loader.isModLoaded("iceandfire")) {
        for (Biome biome : Biome.REGISTRY) {
            if (biome.getBiomeName().isEmpty()) {
                Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome));
                continue;
            }
            String biomeName = biome.getBiomeName();
            String biomeClass = biome.getBiomeClass().getName();
            if (biomeName.equals("Glacier") && biomeClass.equals("com.github.alexthe666.iceandfire.world.BiomeGlacier")) {
                iafGlacier = new RealisticBiomeIAFGlacier(biome);
            }
        }
    }
}
Also used : Biome(net.minecraft.world.biome.Biome)

Example 5 with Biome

use of net.minecraft.world.biome.Biome in project Realistic-Terrain-Generation by Team-RTG.

the class BiomeAnalyzer method determineOceanBiomes.

private void determineOceanBiomes() {
    oceanBiome = new boolean[256];
    for (int i = 0; i < oceanBiome.length; i++) {
        Biome biome = Biome.getBiome(i);
        if (biome == null)
            continue;
        if (biome.getBiomeName().toLowerCase().contains("ocean"))
            oceanBiome[i] = true;
        if (biome.getBiomeName().toLowerCase().contains("kelp"))
            oceanBiome[i] = true;
        if (biome.getBiomeName().toLowerCase().contains("coral"))
            oceanBiome[i] = true;
        if (biome.getBiomeName().toLowerCase().contains("reef"))
            oceanBiome[i] = true;
    }
    // not getting set?
    oceanBiome[Biome.getIdForBiome(Biomes.DEEP_OCEAN)] = true;
}
Also used : Biome(net.minecraft.world.biome.Biome)

Aggregations

Biome (net.minecraft.world.biome.Biome)297 BlockPos (net.minecraft.util.math.BlockPos)113 IBlockState (net.minecraft.block.state.IBlockState)39 ArrayList (java.util.ArrayList)24 World (net.minecraft.world.World)23 ResourceLocation (net.minecraft.util.ResourceLocation)21 ChunkPos (net.minecraft.util.math.ChunkPos)19 Random (java.util.Random)15 Nullable (javax.annotation.Nullable)12 List (java.util.List)11 BiomeTweakEvent (me.superckl.api.biometweaker.event.BiomeTweakEvent)11 CaveBiome (cavern.config.manager.CaveBiome)10 Block (net.minecraft.block.Block)10 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)10 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)8 IExtendedBiome (biomesoplenty.api.biome.IExtendedBiome)7 Map (java.util.Map)7 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)7 Collectors (java.util.stream.Collectors)6 OreGenEvent (net.minecraftforge.event.terraingen.OreGenEvent)6