diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenSilkglades.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenSilkglades.java index 084fee070..61d321561 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenSilkglades.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenSilkglades.java @@ -9,8 +9,6 @@ public class BiomeGenSilkglades extends BOPBiome { super(par1); /* - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; customBiomeDecorator.treesPerChunk = 6; customBiomeDecorator.grassPerChunk = 2; customBiomeDecorator.wheatGrassPerChunk = 1; diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenSpruceWoods.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenSpruceWoods.java index 531691e87..b1b5988c7 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenSpruceWoods.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenSpruceWoods.java @@ -1,61 +1,96 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import java.util.HashMap; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase.Height; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.features.WorldGenBOPFlora; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2; public class BiomeGenSpruceWoods extends BOPBiome { + public BiomeGenSpruceWoods(int id) + { + super(id); + + //TODO: setColor() + this.setColor(6396257); + this.setTemperatureRainfall(0.6F, 0.7F); - @SuppressWarnings("unchecked") - public BiomeGenSpruceWoods(int par1) - { - super(par1); - /* - spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4)); - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 10; - customBiomeDecorator.grassPerChunk = 6; - customBiomeDecorator.sproutsPerChunk = 3; - customBiomeDecorator.mushroomsPerChunk = 4; - customBiomeDecorator.poisonIvyPerChunk = 1; - customBiomeDecorator.berryBushesPerChunk = 3; - customBiomeDecorator.wheatGrassPerChunk = 10; - customBiomeDecorator.carrotsPerChunk = 1; - customBiomeDecorator.bluebellsPerChunk = 100; - customBiomeDecorator.shrubsPerChunk = 5; - customBiomeDecorator.waterReedsPerChunk = 2; - */ - } + this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4)); - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) - { - return par1Random.nextInt(3) == 0 ? new WorldGenTaiga5(false) : new WorldGenTaiga2(false); - } - - @Override - public void decorate(World par1World, Random par2Random, int par3, int par4) - { - super.decorate(par1World, par2Random, par3, par4); - int var5 = 3 + par2Random.nextInt(6); + this.theBiomeDecorator.treesPerChunk = 10; + this.theBiomeDecorator.grassPerChunk = 6; + this.theBiomeDecorator.mushroomsPerChunk = 4; + + this.bopWorldFeatures.bopFlowersPerChunk = 100; + this.bopWorldFeatures.poisonIvyPerChunk = 1; + this.bopWorldFeatures.sproutsPerChunk = 3; + this.bopWorldFeatures.berryBushesPerChunk = 3; + this.bopWorldFeatures.wildCarrotsPerChunk = 1; + this.bopWorldFeatures.shrubsPerChunk = 5; + this.bopWorldFeatures.waterReedsPerChunk = 2; + } - for (int var6 = 0; var6 < var5; ++var6) - { - int var7 = par3 + par2Random.nextInt(16); - int var8 = par2Random.nextInt(28) + 4; - int var9 = par4 + par2Random.nextInt(16); - int var10 = par1World.getBlockId(var7, var8, var9); + @Override + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) + { + return random.nextInt(3) == 0 ? new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 1, 1, false, 9, 9, 6) : + new WorldGenTaiga2(false); + } + + @Override + public HashMap getWeightedWorldGenForBOPFlowers() + { + HashMap flowerMap = new HashMap(); + + flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 5), 1D); + + return flowerMap; + } - Block block = Block.blocksList[var10]; - if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) - { - par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); - } - } - } - */ + @Override + public HashMap getWeightedWorldGenForGrass() + { + HashMap grassMap = new HashMap(); + + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D); + + return grassMap; + } + + @Override + public void decorate(World world, Random random, int chunkX, int chunkZ) + { + super.decorate(world, random, chunkX, chunkZ); + int var5 = 12 + random.nextInt(6); + + for (int var6 = 0; var6 < var5; ++var6) + { + int x = chunkX + random.nextInt(16); + int y = random.nextInt(28) + 4; + int z = chunkZ + random.nextInt(16); + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone)) + { + //TODO: setBlock() + world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 2); + } + } + } } diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenTimber.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenTimber.java index 97d1608ae..fced5e1f9 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenTimber.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenTimber.java @@ -1,89 +1,101 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import java.util.HashMap; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase.Height; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.trees.WorldGenChaparral3; +import biomesoplenty.common.world.features.trees.WorldGenCypress; +import biomesoplenty.common.world.features.trees.WorldGenMiniShrub; public class BiomeGenTimber extends BOPBiome { + private static final Height biomeHeight = new Height(0.3F, 0.4F); - public BiomeGenTimber(int par1) + public BiomeGenTimber(int id) { - super(par1); - /* - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 20; - customBiomeDecorator.grassPerChunk = 8; - customBiomeDecorator.wheatGrassPerChunk = 4; - customBiomeDecorator.thornsPerChunk = 2; - customBiomeDecorator.flowersPerChunk = -999; - customBiomeDecorator.toadstoolsPerChunk = 2; - customBiomeDecorator.waterReedsPerChunk = 4; - customBiomeDecorator.shrubsPerChunk = 10; - */ + super(id); + + //TODO: setHeight() + this.func_150570_a(biomeHeight); + //TODO: setColor() + this.setColor(10923366); + this.setTemperatureRainfall(0.7F, 0.8F); + + this.theBiomeDecorator.treesPerChunk = 20; + this.theBiomeDecorator.grassPerChunk = 8; + this.theBiomeDecorator.flowersPerChunk = -999; + + this.bopWorldFeatures.thornsPerChunk = 2; + this.bopWorldFeatures.toadstoolsPerChunk = 2; + this.bopWorldFeatures.waterReedsPerChunk = 4; + this.bopWorldFeatures.shrubsPerChunk = 10; } - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) - { - return par1Random.nextInt(4) == 0 ? new WorldGenChaparral3() : (par1Random.nextInt(8) == 0 ? new WorldGenChaparral2() : new WorldGenDeciduous2(false)); - } - */ - /** - * Gets a WorldGen appropriate for this biome. - */ - /* @Override - public WorldGenerator getRandomWorldGenForGrass(Random par1Random) - { - return par1Random.nextInt(5) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1); + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) + { + return random.nextInt(4) == 0 ? new WorldGenChaparral3() : + (random.nextInt(8) == 0 ? new WorldGenMiniShrub(Blocks.log, Blocks.leaves, 0, 0, Blocks.grass, Blocks.sand) : + new WorldGenCypress(Blocks.log, Blocks.leaves, 0, 0, false, 10, 15, 2)); } + @Override + public HashMap getWeightedWorldGenForGrass() + { + HashMap grassMap = new HashMap(); + + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 1), 1D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D); + + return grassMap; + } + + @Override + public void decorate(World world, Random random, int chunkX, int chunkZ) + { + super.decorate(world, random, chunkX, chunkZ); + int var5 = 12 + random.nextInt(6); + + for (int var6 = 0; var6 < var5; ++var6) + { + int x = chunkX + random.nextInt(16); + int y = random.nextInt(28) + 4; + int z = chunkZ + random.nextInt(16); + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone)) + { + //TODO: setBlock() + world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 2); + } + } + } + @Override - public void decorate(World par1World, Random par2Random, int par3, int par4) - { - super.decorate(par1World, par2Random, par3, par4); - int var5 = 3 + par2Random.nextInt(6); - - for (int var6 = 0; var6 < var5; ++var6) - { - int var7 = par3 + par2Random.nextInt(16); - int var8 = par2Random.nextInt(28) + 4; - int var9 = par4 + par2Random.nextInt(16); - int var10 = par1World.getBlockId(var7, var8, var9); - - Block block = Block.blocksList[var10]; - if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) - { - par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); - } - } - } - */ - - /** - * Provides the basic grass color based on the biome temperature and rainfall - */ - /* - @Override - public int getBiomeGrassColor() - { + //TODO: getBiomeGrassColor() + public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { return 10923366; } - */ - /** - * Provides the basic foliage color based on the biome temperature and rainfall - */ - /* @Override - public int getBiomeFoliageColor() - { + //TODO: getBiomeFoliageColor() + public int func_150571_c(int x, int y, int z) + { return 11049817; } - */ } diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index f3cb1da71..f278caa04 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -50,7 +50,9 @@ import biomesoplenty.common.biomes.BiomeGenSacredSprings; import biomesoplenty.common.biomes.BiomeGenSeasonalForest; import biomesoplenty.common.biomes.BiomeGenShield; import biomesoplenty.common.biomes.BiomeGenShrubland; +import biomesoplenty.common.biomes.BiomeGenSpruceWoods; import biomesoplenty.common.biomes.BiomeGenThicket; +import biomesoplenty.common.biomes.BiomeGenTimber; import biomesoplenty.common.configuration.BOPConfigurationIDs; import biomesoplenty.common.world.WorldTypeBOP; @@ -140,12 +142,12 @@ public class BOPBiomes registerBiome(new BOPBiomeListEntry(new BiomeGenShield(BOPConfigurationIDs.shieldID).setBiomeName("Shield"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenShrubland(BOPConfigurationIDs.shrublandID).setBiomeName("Shrubland"), BOPBiomeTemperatureType.COOL)); //registerBiome(new BOPBiomeListEntry(new BiomeGenSilkglades(BOPConfigurationIDs.silkgladesID).setBiomeName("Silkglades"), BOPBiomeTemperatureType.COOL)); - /*registerBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM)); - registerBiome(new BOPBiomeListEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), BOPBiomeTemperatureType.WARM)); - registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM));*/ + /*registerBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM));*/ + registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), BOPBiomeTemperatureType.WARM)); + /*registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM));*/ registerBiome(new BOPBiomeListEntry(new BiomeGenThicket(BOPConfigurationIDs.thicketID).setBiomeName("Thicket"), BOPBiomeTemperatureType.WARM)); - /*registerBiome(new BOPBiomeListEntry(new BiomeGenTimber(BOPConfigurationIDs.timberID).setBiomeName("Timber"), BOPBiomeTemperatureType.COOL)); - registerBiome(new BOPBiomeListEntry(new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID).setBiomeName("Tropical Rainforest"), BOPBiomeTemperatureType.HOT)); + registerBiome(new BOPBiomeListEntry(new BiomeGenTimber(BOPConfigurationIDs.timberID).setBiomeName("Timber"), BOPBiomeTemperatureType.COOL)); + /*registerBiome(new BOPBiomeListEntry(new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID).setBiomeName("Tropical Rainforest"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), BOPBiomeTemperatureType.ICY));*/ //registerBiome(new BOPBiomeListEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), BOPBiomeTemperatureType.HOT)); diff --git a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenCypress.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenCypress.java index b3ee79b74..1b82bff68 100644 --- a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenCypress.java +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenCypress.java @@ -52,6 +52,12 @@ public class WorldGenCypress extends WorldGenAbstractTree j1 = l - i1; k1 = 1; break; + + case 2: + i1 = random.nextInt(5) + 3; + j1 = l - i1; + k1 = 1; + break; default: i1 = 3 + random.nextInt(2); @@ -133,7 +139,7 @@ public class WorldGenCypress extends WorldGenAbstractTree if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && world.func_147439_a(l2, k2, j3).canBeReplacedByLeaves(world, l2, k2, j3)) { - if (random.nextInt(3) != 0) + if (random.nextInt(2) != 0) { //TODO: setBlockAndMetadata() this.func_150516_a(world, l2, k2, j3, leaves, this.metaLeaves);