Jump to content

Recommended Posts

Posted

Hi, I just picked up a mod that I started about a year ago and updated it to 1.7.10. Everything is working as it's suppose to, except for one thing.

 

All the biomes are wrong.

 

In my mod, I'm aiming for a sort of pseudo-limited world, where there's only so much of each biome to explore. When you go too far out, the only thing you'll see is ocean.

 

The order is (from spawn outwards):

-My custom forest

-Vanilla forest

-Desert

-Taiga hills

-Ocean

-Deep ocean

 

But in reality, the order is:

-Mushroom island

-Ice plains and cold taiga

-A combination of forest, roofed forest, plains, extreme hills, swamp land, and birch forest (wtf)

-Mushroom island (again?)

-Ocean

-Deep ocean

 

Also, this is what the supposed "ocean" and "deep ocean" biomes look like:

OpPyHXg.png

 

I haven't really grasped what happens during world generation, but my guess is that my biome is incompatible somehow and the combinations are due to the temperature functions trying to add in all the biomes that are compatible with each other.

 

What I've tried is to override the getModdedBiomeGenerators method in my WorldChunkManager and just return the original array, but that didn't change anything.

 

 

Finally, here's my code:

 

WorldTypeT:

package terrarium.world;

import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.layer.GenLayer;

public class WorldTypeT extends WorldType {
public int size;

public WorldTypeT(int size) {
	super("SIZE" + size);
	this.size = size;
}
}

 

WorldProviderT:

package terrarium.world;

import net.minecraft.world.WorldProvider;
import net.minecraft.world.chunk.IChunkProvider;

public class WorldProviderT extends WorldProvider {
@Override
protected void registerWorldChunkManager() {
	this.worldChunkMgr = new WorldChunkManagerT(this.getSeed(), (WorldTypeT) this.terrainType);
}

@Override
public IChunkProvider createChunkGenerator() {
	return new ChunkProviderT(this.worldObj, this.getSeed());
}

@Override
public String getDimensionName() {
	return "Overworld";
}
}

 

WorldChunkManagerT:

package terrarium.world;

import java.util.ArrayList;
import java.util.Arrays;

import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeCache;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.gen.layer.GenLayer;
import terrarium.util.Util;
import terrarium.world.biome.Biomes;

public class WorldChunkManagerT extends WorldChunkManager {
public WorldChunkManagerT(long seed, WorldTypeT worldType) {
	super(seed, worldType);

	GenLayer pre = (GenLayer) Util.getFieldValue("genBiomes", WorldChunkManager.class, this);

	pre = GenLayerBiomeT.getLayer(seed, pre, worldType);

	Util.replaceField("genBiomes", WorldChunkManager.class, pre, this);
	Util.replaceField("biomeIndexLayer", WorldChunkManager.class, pre, this);

	System.err.println("YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO");

	allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(Biomes.forest, BiomeGenBase.desert));

	Util.replaceField("biomeCache", WorldChunkManager.class, new BiomeCache(this), this);
}

@Override
    public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) {
	return original;
}
}

 

ChunkProviderT:

package terrarium.world;

import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.util.IProgressUpdate;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.SpawnerAnimals;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.MapGenCaves;
import net.minecraft.world.gen.NoiseGenerator;
import net.minecraft.world.gen.NoiseGeneratorOctaves;
import net.minecraft.world.gen.NoiseGeneratorPerlin;
import net.minecraft.world.gen.feature.WorldGenDungeons;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.structure.MapGenStronghold;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.ChunkProviderEvent;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
import cpw.mods.fml.common.eventhandler.Event.Result;

public class ChunkProviderT implements IChunkProvider {
private Random r;

private NoiseGeneratorOctaves noiseGen1;
private NoiseGeneratorOctaves noiseGen2;
private NoiseGeneratorOctaves noiseGen3;

private NoiseGeneratorPerlin perlinGen;

public NoiseGeneratorOctaves terrainGen1;
public NoiseGeneratorOctaves terrainGen2;

public NoiseGeneratorOctaves mobSpawnerNoise;

private World world;

private WorldType worldType;

private final double[] noiseField;
private final float[] parabolicField;

private double[] stoneNoise = new double[256];
private MapGenBase caveGenerator = new MapGenCaves();

private MapGenStronghold strongholdGenerator = new MapGenStronghold();

private BiomeGenBase[] biomesForGeneration;

double[] noiseField1;
double[] noiseField2;
double[] noiseField3;

double[] terrainNoiseField2;

{
	caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE);
	strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD);
}

public ChunkProviderT(World world, long seed) {
	this.world = world;

	worldType = world.getWorldInfo().getTerrainType();

	r = new Random(seed);

	noiseGen1 = new NoiseGeneratorOctaves(r, 16);
	noiseGen2 = new NoiseGeneratorOctaves(r, 16);
	noiseGen3 = new NoiseGeneratorOctaves(r, ;

	perlinGen = new NoiseGeneratorPerlin(r, 4);

	terrainGen1 = new NoiseGeneratorOctaves(r, 10);
	terrainGen2 = new NoiseGeneratorOctaves(r, 16);

	mobSpawnerNoise = new NoiseGeneratorOctaves(r, ;

	noiseField = new double[825];
	parabolicField = new float[25];

	for(int j = -2; j <= 2; ++j) {
		for(int k = -2; k <= 2; ++k) {
			float f = 10.0F / MathHelper.sqrt_float((float) (j * j + k * k) + 0.2F);
			parabolicField[j + 2 + (k + 2) * 5] = f;
		}
	}

	NoiseGenerator[] noiseGens = { noiseGen1, noiseGen2, noiseGen3, perlinGen, terrainGen1, terrainGen2, mobSpawnerNoise };
	noiseGens = TerrainGen.getModdedNoiseGenerators(world, r, noiseGens);

	noiseGen1 = (NoiseGeneratorOctaves) noiseGens[0];
	noiseGen2 = (NoiseGeneratorOctaves) noiseGens[1];
	noiseGen3 = (NoiseGeneratorOctaves) noiseGens[2];

	perlinGen = (NoiseGeneratorPerlin) noiseGens[3];

	terrainGen1 = (NoiseGeneratorOctaves) noiseGens[4];
	terrainGen2 = (NoiseGeneratorOctaves) noiseGens[5];

	mobSpawnerNoise = (NoiseGeneratorOctaves) noiseGens[6];
}

public void fillBlockArray(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) {
	byte b0 = 63;
	biomesForGeneration = world.getWorldChunkManager().getBiomesForGeneration(biomesForGeneration, p_147424_1_ * 4 - 2, p_147424_2_ * 4 - 2, 10, 10);
	func_147423_a(p_147424_1_ * 4, 0, p_147424_2_ * 4);

	for(int k = 0; k < 4; ++k) {
		int l = k * 5;
		int i1 = (k + 1) * 5;

		for(int j1 = 0; j1 < 4; ++j1) {
			int k1 = (l + j1) * 33;
			int l1 = (l + j1 + 1) * 33;
			int i2 = (i1 + j1) * 33;
			int j2 = (i1 + j1 + 1) * 33;

			for(int k2 = 0; k2 < 32; ++k2) {
				double d0 = 0.125D;

				double d1 = noiseField[k1 + k2];
				double d2 = noiseField[l1 + k2];
				double d3 = noiseField[i2 + k2];
				double d4 = noiseField[j2 + k2];

				double d5 = (noiseField[k1 + k2 + 1] - d1) * d0;
				double d6 = (noiseField[l1 + k2 + 1] - d2) * d0;
				double d7 = (noiseField[i2 + k2 + 1] - d3) * d0;
				double d8 = (noiseField[j2 + k2 + 1] - d4) * d0;

				for(int l2 = 0; l2 < 8; ++l2) {
					double d9 = 0.25D;

					double d10 = d1;
					double d11 = d2;

					double d12 = (d3 - d1) * d9;
					double d13 = (d4 - d2) * d9;

					for(int i3 = 0; i3 < 4; ++i3) {
						int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2;
						short short1 = 256;

						j3 -= short1;

						double d14 = 0.25D;
						double d16 = (d11 - d10) * d14;
						double d15 = d10 - d16;

						for(int k3 = 0; k3 < 4; ++k3) {
							if((d15 += d16) > 0.0D) {
								p_147424_3_[j3 += short1] = Blocks.stone;
							} else if(k2 * 8 + l2 < b0) {
								p_147424_3_[j3 += short1] = Blocks.water;
							} else {
								p_147424_3_[j3 += short1] = null;
							}
						}

						d10 += d12;
						d11 += d13;
					}

					d1 += d5;
					d2 += d6;
					d3 += d7;
					d4 += d8;
				}
			}
		}
	}
}

public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) {
	ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_, world);

	MinecraftForge.EVENT_BUS.post(event);

	if(event.getResult() == Result.DENY) {
		return;
	}

	double d0 = 0.03125D;

	stoneNoise = perlinGen.func_151599_a(stoneNoise, (double) (p_147422_1_ * 16), (double) (p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

	for(int k = 0; k < 16; ++k) {
		for(int l = 0; l < 16; ++l) {
			BiomeGenBase biomegenbase = p_147422_5_[l + k * 16];

			biomegenbase.genTerrainBlocks(world, r, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, stoneNoise[l + k * 16]);
		}
	}
}

public Chunk loadChunk(int p_73158_1_, int p_73158_2_) {
	return provideChunk(p_73158_1_, p_73158_2_);
}

public Chunk provideChunk(int p_73154_1_, int p_73154_2_) {
	r.setSeed((long) p_73154_1_ * 341873128712L + (long) p_73154_2_ * 132897987541L);

	Block[] ablock = new Block[65536];
	byte[] abyte = new byte[65536];

	fillBlockArray(p_73154_1_, p_73154_2_, ablock);

	biomesForGeneration = world.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16);

	replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, biomesForGeneration);

	caveGenerator.func_151539_a(this, world, p_73154_1_, p_73154_2_, ablock);

	strongholdGenerator.func_151539_a(this, world, p_73154_1_, p_73154_2_, ablock);

	Chunk chunk = new Chunk(world, ablock, abyte, p_73154_1_, p_73154_2_);
	byte[] abyte1 = chunk.getBiomeArray();

	for(int k = 0; k < abyte1.length; ++k) {
		abyte1[k] = (byte) biomesForGeneration[k].biomeID;
	}

	chunk.generateSkylightMap();

	return chunk;
}

private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) {
	double d0 = 684.412D;
	double d1 = 684.412D;

	double d2 = 512.0D;
	double d3 = 512.0D;

	terrainNoiseField2 = terrainGen2.generateNoiseOctaves(terrainNoiseField2, p_147423_1_, p_147423_3_, 5, 5, 200.0D, 200.0D, 0.5D);

	noiseField1 = noiseGen1.generateNoiseOctaves(noiseField1, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D);
	noiseField2 = noiseGen2.generateNoiseOctaves(noiseField2, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D);
	noiseField3 = noiseGen3.generateNoiseOctaves(noiseField3, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D);

	boolean flag1 = false;
	boolean flag = false;

	int l = 0;
	int i1 = 0;

	double d4 = 8.5D;

	for(int j1 = 0; j1 < 5; ++j1) {
		for(int k1 = 0; k1 < 5; ++k1) {
			float f = 0.0F;
			float f1 = 0.0F;
			float f2 = 0.0F;

			byte b0 = 2;

			BiomeGenBase biomegenbase = biomesForGeneration[j1 + 2 + (k1 + 2) * 10];

			for(int l1 = -b0; l1 <= b0; ++l1) {
				for(int i2 = -b0; i2 <= b0; ++i2) {
					BiomeGenBase biomegenbase1 = biomesForGeneration[j1 + l1 + 2 + (k1 + i2 + 2) * 10];

					float f3 = biomegenbase1.rootHeight;
					float f4 = biomegenbase1.heightVariation;

					if(worldType == WorldType.AMPLIFIED && f3 > 0.0F) {
						f3 = 1.0F + f3 * 2.0F;
						f4 = 1.0F + f4 * 4.0F;
					}

					float f5 = parabolicField[l1 + 2 + (i2 + 2) * 5] / (f3 + 2.0F);

					if(biomegenbase1.rootHeight > biomegenbase.rootHeight) {
						f5 /= 2.0F;
					}

					f += f4 * f5;
					f1 += f3 * f5;
					f2 += f5;
				}
			}

			f /= f2;
			f1 /= f2;
			f = f * 0.9F + 0.1F;
			f1 = (f1 * 4.0F - 1.0F) / 8.0F;

			double d12 = terrainNoiseField2[i1] / 8000.0D;

			if(d12 < 0.0D) {
				d12 = -d12 * 0.3D;
			}

			d12 = d12 * 3.0D - 2.0D;

			if(d12 < 0.0D) {
				d12 /= 2.0D;

				if(d12 < -1.0D) {
					d12 = -1.0D;
				}

				d12 /= 1.4D;
				d12 /= 2.0D;
			} else {
				if(d12 > 1.0D) {
					d12 = 1.0D;
				}

				d12 /= 8.0D;
			}

			++i1;

			double d13 = (double) f1;
			double d14 = (double) f;

			d13 += d12 * 0.2D;
			d13 = d13 * 8.5D / 8.0D;

			double d5 = 8.5D + d13 * 4.0D;

			for(int j2 = 0; j2 < 33; ++j2) {
				double d6 = ((double) j2 - d5) * 12.0D * 128.0D / 256.0D / d14;

				if(d6 < 0.0D) {
					d6 *= 4.0D;
				}

				double d7 = noiseField1[l] / 512.0D;
				double d8 = noiseField2[l] / 512.0D;
				double d9 = (noiseField3[l] / 10.0D + 1.0D) / 2.0D;

				double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6;

				if(j2 > 29) {
					double d11 = (double) ((float) (j2 - 29) / 3.0F);

					d10 = d10 * (1.0D - d11) + -10.0D * d11;
				}

				noiseField[l] = d10;

				++l;
			}
		}
	}
}

public boolean chunkExists(int p_73149_1_, int p_73149_2_) {
	return true;
}

public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) {
	BlockFalling.fallInstantly = true;

	int k = p_73153_2_ * 16;
	int l = p_73153_3_ * 16;

	BiomeGenBase biomegenbase = world.getBiomeGenForCoords(k + 16, l + 16);

	r.setSeed(world.getSeed());

	long i1 = r.nextLong() / 2L * 2L + 1L;
	long j1 = r.nextLong() / 2L * 2L + 1L;

	r.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ world.getSeed());

	boolean flag = false;

	MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, world, r, p_73153_2_, p_73153_3_, flag));

	strongholdGenerator.generateStructuresInChunk(world, r, p_73153_2_, p_73153_3_);

	int k1;
	int l1;
	int i2;

	biomegenbase.decorate(world, r, k, l);

	if(TerrainGen.populate(p_73153_1_, world, r, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS)) {
		SpawnerAnimals.performWorldGenSpawning(world, biomegenbase, k + 8, l + 8, 16, 16, r);
	}

	k += 8;
	l += 8;

	boolean doGen = TerrainGen.populate(p_73153_1_, world, r, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE);

	for(k1 = 0; doGen && k1 < 16; ++k1) {
		for(l1 = 0; l1 < 16; ++l1) {
			i2 = world.getPrecipitationHeight(k + k1, l + l1);

			if(world.isBlockFreezable(k1 + k, i2 - 1, l1 + l)) {
				world.setBlock(k1 + k, i2 - 1, l1 + l, Blocks.ice, 0, 2);
			}

			if(world.func_147478_e(k1 + k, i2, l1 + l, true)) {
				world.setBlock(k1 + k, i2, l1 + l, Blocks.snow_layer, 0, 2);
			}
		}
	}

	MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, world, r, p_73153_2_, p_73153_3_, flag));

	BlockFalling.fallInstantly = false;
}

public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) {
	return true;
}

public void saveExtraData() {
}

public boolean unloadQueuedChunks() {
	return false;
}

public boolean canSave() {
	return true;
}

public String makeString() {
	return "RandomLevelSource";
}

public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) {
	return world.getBiomeGenForCoords(p_73155_2_, p_73155_4_).getSpawnableList(p_73155_1_);
}

public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) {
	return "Stronghold".equals(p_147416_2_) && strongholdGenerator != null ? strongholdGenerator.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_, p_147416_5_) : null;
}

public int getLoadedChunkCount() {
	return 0;
}

public void recreateStructures(int p_82695_1_, int p_82695_2_) {
	strongholdGenerator.func_151539_a(this, world, p_82695_1_, p_82695_2_, (Block[]) null);
}
}

 

GenLayerBiomeT:

package terrarium.world;

import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerBiome;
import net.minecraft.world.gen.layer.GenLayerBiomeEdge;
import net.minecraft.world.gen.layer.GenLayerZoom;
import net.minecraft.world.gen.layer.IntCache;
import terrarium.util.MathUtil;
import terrarium.world.biome.Biomes;

public class GenLayerBiomeT extends GenLayerBiome {
public int size;

public GenLayerBiomeT(long seed, GenLayer parent, WorldTypeT worldType) {
	super(seed, parent, worldType);
	this.size = worldType.size;
}

@Override
public int[] getInts(int chunkX, int chunkZ, int par3, int par4) {
	int[] current = IntCache.getIntCache(par3 * par4);

	int realX;
	int realZ;
	double distance;

	for(int z = 0; z < par4; z++) {
		for(int x = 0; x < par3; x++) {
			realX = x + chunkX;
			realZ = z + chunkZ;

			this.initChunkSeed((long) realX, (long) realZ);

			distance = MathUtil.getDistance2D(0, 0, realX, realZ);

			if(distance > 24 * size) {
				current[x + z * par3] = BiomeGenBase.deepOcean.biomeID;
			} else if(distance > 12 * size) {
				current[x + z * par3] = BiomeGenBase.ocean.biomeID;
			} else if(distance > 9 * size) {
				current[x + z * par3] = BiomeGenBase.taigaHills.biomeID;
			} else if(distance > 6 * size) {
				current[x + z * par3] = BiomeGenBase.desert.biomeID;
			} else if(distance > 3 * size) {
				current[x + z * par3] = BiomeGenBase.forest.biomeID;
			} else {
				current[x + z * par3] = Biomes.forest.biomeID;
			}
		}
	}

	return current;
}

public static GenLayer getLayer(long seed, GenLayer parentLayer, WorldTypeT type) {
	GenLayer ret = new GenLayerBiome(200L, new GenLayerBiomeT(seed, parentLayer, type), type);
	ret = GenLayerZoom.magnify(1000L, ret, 2);
	ret = new GenLayerBiomeEdge(1000L, ret);

	return ret;
}
}

 

BiomeGenForestT:

package terrarium.world.biome;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import terrarium.util.WorldUtil;
import terrarium.world.gen.WorldGenForestTree;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BiomeGenForestT extends BiomeGenBase {
public BiomeGenForestT() {
	super(48);
	this.setHeight(new BiomeGenBase.Height(BiomeGenMod.DEFAULT_ROOT_HEIGHT, 0.2F));
	this.setColor(0x1CD85E);
	this.setTemperatureRainfall(0.7F, 0.8F);
	this.setBiomeName("Forest");

	this.theBiomeDecorator.treesPerChunk = 4;
	this.theBiomeDecorator.grassPerChunk = 2;
}

@Override
@SideOnly(Side.CLIENT)
public int getBiomeGrassColor(int x, int y, int z) {
	return 0x1CD85E;
}

@Override
@SideOnly(Side.CLIENT)
public int getBiomeFoliageColor(int x, int y, int z) {
	return 0x69DD3E;
}

@Override
public void decorate(World world, Random random, int x, int z) {
	for(int i = 0; i < this.theBiomeDecorator.treesPerChunk; i++) {
		WorldGenForestTree.generate(world, random, x + random.nextInt(16), WorldUtil.getTopBlock(world, x, z), z + random.nextInt(16));
	}
}
}

 

WorldCreation (this is where I initialize all the world stuff):

package terrarium.world.biome;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import terrarium.util.WorldUtil;
import terrarium.world.gen.WorldGenForestTree;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BiomeGenForestT extends BiomeGenBase {
public BiomeGenForestT() {
	super(48);
	this.setHeight(new BiomeGenBase.Height(BiomeGenMod.DEFAULT_ROOT_HEIGHT, 0.2F));
	this.setColor(0x1CD85E);
	this.setTemperatureRainfall(0.7F, 0.8F);
	this.setBiomeName("Forest");

	this.theBiomeDecorator.treesPerChunk = 4;
	this.theBiomeDecorator.grassPerChunk = 2;
}

@Override
@SideOnly(Side.CLIENT)
public int getBiomeGrassColor(int x, int y, int z) {
	return 0x1CD85E;
}

@Override
@SideOnly(Side.CLIENT)
public int getBiomeFoliageColor(int x, int y, int z) {
	return 0x69DD3E;
}

@Override
public void decorate(World world, Random random, int x, int z) {
	for(int i = 0; i < this.theBiomeDecorator.treesPerChunk; i++) {
		WorldGenForestTree.generate(world, random, x + random.nextInt(16), WorldUtil.getTopBlock(world, x, z), z + random.nextInt(16));
	}
}

 

TL;DR: biome no worky, pls help

 

 

Thanks :D

Kain

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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