Jump to content

[SOLVED] [1.6.4] Spawning mobs in other mods biomes


saxon564

Recommended Posts

now i know the quick fix would be doing BiomeGenBase.* or something like that, but what  wondering is if there is a way to get the temperature for the biome and spawn that way, i seem to recall that this was possible, but im not finding it without calling a specific biome. Could anyone explain how this would work? I am looking at the source for Mo' Creatures, but he adds mobs in a roundabout way.

Link to comment
Share on other sites

In post init loop through the list of biomes:

 

public static void generateBiomeData()
{
	for (int i = 0; i < BiomeGenBase.biomeList.length; i++) {
		BiomeGenBase biome = BiomeGenBase.biomeList[i];
		if (biome != null)
			if (biome.biomeName == null) {
				System.out.println("[Wispy] Biome (id " + i + ") has null name, could not build spawn information.");
			}
			else
			{
				String name = biome.biomeName.toLowerCase();
				float E = biome.temperature;
				float F = biome.rainfall;
				float H = biome.minHeight;
				int I = biome.theBiomeDecorator.flowersPerChunk;
				int J = biome.theBiomeDecorator.grassPerChunk;
				int K = biome.theBiomeDecorator.treesPerChunk;
			}
		}
	}
}

 

There are other factors too, those just happened to be ones I was using for a mod (my variable names ended up coming from an excel spreadsheet.  F was column F, etc).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Changing a mod's biome is impossible otherwise you have the mod sources and the ability to change the source !

 

If you only want to create a new Biome, no problem it's simple (very, i think a big noob or troll can do it) !

 

My Biome code :

package fr.stoneline.biome;

import cpw.mods.fml.common.registry.GameRegistry;

public class Biomes {
        // The stoneline biome is not generated by Minecraft World Generator (it's the StoneLine Dimension Biome Template)
public static BiomeGenStoneLine stoneLineBiome;

        // The automn biome is a normal biome auto generated by Minecraft World Generator
public static BiomeGenAutomn automnBiome;

public void registerBiomes(){
	GameRegistry.addBiome(automnBiome); // Registering biome to authorize Minecraft to generate it
}

static {
	stoneLineBiome = new BiomeGenStoneLine();
	automnBiome = new BiomeGenAutomn();
}
}

The automn biome :

package fr.stoneline.biome;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.*;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;

public class BiomeGenAutomn extends BiomeGenBase {
public BiomeGenAutomn() {
	super(24);
	setBiomeName("autumn");
	topBlock = (byte) Block.grass.blockID;
	fillerBlock = (byte) Block.dirt.blockID;
	theBiomeDecorator.generateLakes = true;
	theBiomeDecorator.treesPerChunk = 10;
	theBiomeDecorator.flowersPerChunk = 10;
	theBiomeDecorator.grassPerChunk = 10;
	theBiomeDecorator.deadBushPerChunk = 10;
	theBiomeDecorator.mushroomsPerChunk = 10;
	theBiomeDecorator.reedsPerChunk = 10;
	theBiomeDecorator.cactiPerChunk = 10;
	theBiomeDecorator.sandPerChunk = 10;
	rainfall = 0.7F;
	minHeight = 0.1F;
	maxHeight = 0.3F;
	waterColorMultiplier = 0xd9aa0d;

	this.spawnableMonsterList.clear();
	this.spawnableCreatureList.clear();
	this.spawnableWaterCreatureList.clear();
	this.spawnableCaveCreatureList.clear();
	this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5,
			1, 5));
	this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 5,
			1, 5));
	this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class,
			5, 1, 5));
	this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 5,
			1, 5));
	this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 5,
			1, 5));
	this.spawnableWaterCreatureList.add(new SpawnListEntry(
			EntitySquid.class, 5, 1, 5));
	this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5,
			1, 5));
}

@SideOnly(Side.CLIENT)
public int getBiomeGrassColor() {
	return 0xd4c941;
}

@SideOnly(Side.CLIENT)
public int getBiomeFoliageColor() {
	return 0xd4c941;
}

@SideOnly(Side.CLIENT)
public int getSkyColorByTemp(float par1) {
	return 0xffffff;
}
}

This code is completely working.

Note : this code is part of the StoneLine Developpement Team. Do not copy/paste into your own project. It's only an example.

Note 2 : All StoneLine Developpement Team compilations are under Copyright. You may not destroy it.

If you are destroying the copyright, I will no longer help you finding solutions to your problems. So if you want some help from me, don't destroy my copyright.

 

Yuri6037

Link to comment
Share on other sites

Changing a mod's biome is impossible otherwise you have the mod sources and the ability to change the source !

 

If you only want to create a new Biome, no problem it's simple (very, i think a big noob or troll can do it) !

 

I have this feeling you didn't read what they're trying to do.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

In post init loop through the list of biomes:

 

public static void generateBiomeData()
{
	for (int i = 0; i < BiomeGenBase.biomeList.length; i++) {
		BiomeGenBase biome = BiomeGenBase.biomeList[i];
		if (biome != null)
			if (biome.biomeName == null) {
				System.out.println("[Wispy] Biome (id " + i + ") has null name, could not build spawn information.");
			}
			else
			{
				String name = biome.biomeName.toLowerCase();
				float E = biome.temperature;
				float F = biome.rainfall;
				float H = biome.minHeight;
				int I = biome.theBiomeDecorator.flowersPerChunk;
				int J = biome.theBiomeDecorator.grassPerChunk;
				int K = biome.theBiomeDecorator.treesPerChunk;
			}
		}
	}
}

 

There are other factors too, those just happened to be ones I was using for a mod (my variable names ended up coming from an excel spreadsheet.  F was column F, etc).

Thanks, and from this i can set up some arrays for temperature ranges then spawn my mobs off of that :D

Link to comment
Share on other sites

Yup!

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.