merci robin, je dois faire d’autres class pour pouvoir le trouver mon biome ? en sachant que j’aimerais avoir des immenses arbres dans ce biome.
j’ai aucune erreur (enfin eclipse me le dit pas ^^)
voila celle que j’ai pour le moment :
class principale :
public static BiomeGenBase giantBiome;
giantBiome = new GiantBiome(40).setBiomeName(“Giant”);
BiomeDictionary.registerBiomeType(giantBiome, Type.MOUNTAIN);
BiomeManager.addSpawnBiome(giantBiome);
class GiantBiome :
| |
| package fr.craftesys.crftesys.biome; |
| |
| import java.util.Random; |
| |
| import net.minecraft.block.Block; |
| import net.minecraft.entity.monster.EntityCreeper; |
| import net.minecraft.entity.monster.EntityEnderman; |
| import net.minecraft.entity.monster.EntitySkeleton; |
| import net.minecraft.entity.monster.EntitySlime; |
| import net.minecraft.entity.monster.EntitySpider; |
| import net.minecraft.entity.monster.EntityWitch; |
| import net.minecraft.entity.monster.EntityZombie; |
| import net.minecraft.entity.passive.EntityBat; |
| import net.minecraft.entity.passive.EntityChicken; |
| import net.minecraft.entity.passive.EntityCow; |
| import net.minecraft.entity.passive.EntityPig; |
| import net.minecraft.entity.passive.EntitySheep; |
| import net.minecraft.entity.passive.EntitySquid; |
| import net.minecraft.init.Blocks; |
| import net.minecraft.world.World; |
| import net.minecraft.world.biome.BiomeGenBase; |
| import net.minecraft.world.gen.feature.WorldGenBigTree; |
| import net.minecraft.world.gen.feature.WorldGenTrees; |
| import net.minecraft.world.gen.feature.WorldGenerator; |
| |
| public class GiantBiome extends BiomeGenBase { |
| public Block topBlock; |
| private int grassPerChunk; |
| |
| public GiantBiome(int par1) { |
| super(par1); |
| this.topBlock = Blocks.redstone_ore; |
| this.theBiomeDecorator.treesPerChunk = 10; |
| this.waterColorMultiplier = 0x00FFFF; |
| this.grassPerChunk = 1; |
| this.topBlock = Blocks.wool; |
| this.worldGeneratorBigTree = new WorldGenBigTree(false); |
| this.theBiomeDecorator = this.createBiomeDecorator(); |
| this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); |
| this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4)); |
| this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); |
| this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4)); |
| this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4)); |
| this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4)); |
| this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4)); |
| this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4)); |
| this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4)); |
| this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4)); |
| this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); |
| this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); |
| this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); |
| this.addDefaultFlowers(); |
| this.setMinMaxHeight(0.2F, .9F); |
| } |
| private void setMinMaxHeight(float f, float g) { |
| |
| |
| } |
| public int getBiomeGrassColor() |
| { |
| |
| return 0xFF0C00; |
| } |
| public void decorate(World par1World, Random par2Random, int par3, int par4) |
| { |
| super.decorate(par1World, par2Random, par3, par4); |
| if (par2Random.nextInt(1000) == 0) |
| { |
| int k = par3 + par2Random.nextInt(16) + 25; |
| int l = par4 + par2Random.nextInt(16) + 25; |
| } |
| } |
| public WorldGenerator getRandomWorldGenForTrees(Random par1Random) |
| { |
| return (WorldGenerator)(par1Random.nextInt(5) == 0 ? new WorldGenTrees(false, 30, 2, 2, false) : (par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : new WorldGenTrees(false, 40, 0, 0, false))); |
| } |
| } |
| |