Merge branch 'master' of https://github.com/ted80/BiomesOPlenty
This commit is contained in:
commit
3f1e07176a
14 changed files with 86 additions and 9 deletions
|
@ -2,7 +2,4 @@
|
|||
- Fix darts moving too fast and doing too much damage.
|
||||
- Try to fix Promised Land lag.
|
||||
- Add Acacia trees from BWG4.
|
||||
- Add cooked portobellos.
|
||||
- Give waterlilies a proper render method and hitbox.
|
||||
- Add sunflowers.
|
||||
- Reduce excessive amounts of mobs in the Promised Lands.
|
|
@ -58,6 +58,7 @@ import biomesoplenty.worldgen.WorldGenShield;
|
|||
import biomesoplenty.worldgen.WorldGenSmolderingGrass;
|
||||
import biomesoplenty.worldgen.WorldGenSprout;
|
||||
import biomesoplenty.worldgen.WorldGenSteppe;
|
||||
import biomesoplenty.worldgen.WorldGenSunflower;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -186,6 +187,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
|||
protected WorldGenerator quicksandGen;
|
||||
protected WorldGenerator quicksand2Gen;
|
||||
protected WorldGenerator poisonIvyGen;
|
||||
protected WorldGenerator sunflowerGen;
|
||||
protected WorldGenerator crystalGen;
|
||||
protected WorldGenerator crystalGen2;
|
||||
|
||||
|
@ -259,6 +261,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
|||
protected int quicksandPerChunk;
|
||||
protected int quicksand2PerChunk;
|
||||
protected int poisonIvyPerChunk;
|
||||
protected int sunflowersPerChunk;
|
||||
|
||||
/** The amount of tall grass to generate per chunk. */
|
||||
protected int grassPerChunk;
|
||||
|
@ -393,6 +396,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
|||
this.holyTallGrassGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 4);
|
||||
this.desertSproutsGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 2);
|
||||
this.poisonIvyGen = new WorldGenBush(Blocks.foliage.get().blockID, 7);
|
||||
this.sunflowerGen = new WorldGenSunflower(Blocks.flowers.get().blockID, 13);
|
||||
this.promisedWillowGen = new WorldGenPromisedWillow();
|
||||
this.quicksandGen = new WorldGenQuicksand();
|
||||
this.quicksand2Gen = new WorldGenQuicksand2();
|
||||
|
@ -459,6 +463,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
|||
this.portobellosPerChunk = 0;
|
||||
this.blueMilksPerChunk = 0;
|
||||
this.glowshroomsPerChunk = 0;
|
||||
this.sunflowersPerChunk = 0;
|
||||
this.sproutsPerChunk = 0;
|
||||
this.bushesPerChunk = 0;
|
||||
this.tinyCactiPerChunk = 0;
|
||||
|
@ -775,6 +780,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
|||
this.plantRedGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
|
||||
}
|
||||
|
||||
for (var2 = 0; var2 < this.sunflowersPerChunk; ++var2)
|
||||
{
|
||||
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
var4 = this.randomGenerator.nextInt(128);
|
||||
var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
this.sunflowerGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
|
||||
}
|
||||
|
||||
for (var2 = 0; var2 < this.crystalsPerChunk; ++var2)
|
||||
{
|
||||
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
|
|
|
@ -27,6 +27,7 @@ public class BiomeGenForestNew extends BiomeGenBase
|
|||
this.customBiomeDecorator.whiteFlowersPerChunk = 1;
|
||||
this.customBiomeDecorator.reedsBOPPerChunk = 5;
|
||||
this.customBiomeDecorator.poisonIvyPerChunk = 2;
|
||||
this.customBiomeDecorator.sunflowersPerChunk = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,8 +30,9 @@ public class BiomeGenGarden extends BiomeGenBase
|
|||
this.customBiomeDecorator.flowersPerChunk = 20;
|
||||
this.customBiomeDecorator.whiteFlowersPerChunk = 25;
|
||||
this.customBiomeDecorator.tinyFlowersPerChunk = 15;
|
||||
this.customBiomeDecorator.hydrangeasPerChunk = 10;
|
||||
this.customBiomeDecorator.sproutsPerChunk = 5;
|
||||
this.customBiomeDecorator.hydrangeasPerChunk = 3;
|
||||
this.customBiomeDecorator.sproutsPerChunk = 2;
|
||||
this.customBiomeDecorator.sunflowersPerChunk = 4;
|
||||
this.customBiomeDecorator.rosesPerChunk = 20;
|
||||
this.customBiomeDecorator.grassPerChunk = 25;
|
||||
this.customBiomeDecorator.sandPerChunk = -999;
|
||||
|
@ -48,7 +49,7 @@ public class BiomeGenGarden extends BiomeGenBase
|
|||
*/
|
||||
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
|
||||
{
|
||||
return (par1Random.nextInt(3) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 1) : (par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : (par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1))));
|
||||
return new WorldGenTallGrass(Block.tallGrass.blockID, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,6 +26,7 @@ public class BiomeGenMeadow extends BiomeGenBase
|
|||
this.customBiomeDecorator.sandPerChunk = -999;
|
||||
this.customBiomeDecorator.sandPerChunk2 = -999;
|
||||
this.customBiomeDecorator.hydrangeasPerChunk = 3;
|
||||
this.customBiomeDecorator.sunflowersPerChunk = 1;
|
||||
this.customBiomeDecorator.generatePumpkins = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ public class BiomeGenOrchard extends BiomeGenBase
|
|||
this.customBiomeDecorator.tinyFlowersPerChunk = 20;
|
||||
this.customBiomeDecorator.grassPerChunk = 15;
|
||||
this.customBiomeDecorator.portobellosPerChunk = 2;
|
||||
this.customBiomeDecorator.sunflowersPerChunk = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,6 +24,7 @@ public class BiomeGenPlainsNew extends BiomeGenBase
|
|||
this.customBiomeDecorator.grassPerChunk = 10;
|
||||
this.customBiomeDecorator.tinyFlowersPerChunk = 1;
|
||||
this.customBiomeDecorator.portobellosPerChunk = 1;
|
||||
this.customBiomeDecorator.sunflowersPerChunk = 2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@ public class BiomeGenTropics extends BiomeGenBase
|
|||
this.customBiomeDecorator.sandPerChunk2 = 50;
|
||||
this.customBiomeDecorator.orangeFlowersPerChunk = 10;
|
||||
this.customBiomeDecorator.whiteFlowersPerChunk = 4;
|
||||
this.customBiomeDecorator.sunflowersPerChunk = 2;
|
||||
this.customBiomeDecorator.generatePumpkins = false;
|
||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6));
|
||||
this.spawnableCreatureList.clear();
|
||||
|
|
|
@ -4,6 +4,7 @@ import biomesoplenty.BiomesOPlenty;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
|
@ -16,7 +17,10 @@ import net.minecraft.world.World;
|
|||
public class ItemBOPFlower extends ItemBlock
|
||||
{
|
||||
private static final String[] plants = new String[] {"clover", "swampflower", "deadbloom", "glowflower", "hydrangea", "daisy", "tulip", "wildflower", "violet", "anemone", "lilyflower", "cactus", "aloe", "sunflowerbottom", "sunflowertop", "dandelion"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private Icon[] textures;
|
||||
private static final int SUNFLOWERTOP = 14;
|
||||
|
||||
public ItemBOPFlower(int par1)
|
||||
{
|
||||
super(par1);
|
||||
|
@ -29,17 +33,28 @@ public class ItemBOPFlower extends ItemBlock
|
|||
{
|
||||
return meta & 15;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[1];
|
||||
|
||||
textures[0] = iconRegister.registerIcon("BiomesOPlenty:item_sunflower");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return (new StringBuilder()).append(plants[itemStack.getItemDamage()]).toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int meta)
|
||||
{
|
||||
return Block.blocksList[this.itemID].getIcon(0, meta);
|
||||
if (meta == 13)
|
||||
return textures[0];
|
||||
else
|
||||
return Block.blocksList[this.itemID].getIcon(0, meta);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -128,6 +143,9 @@ public class ItemBOPFlower extends ItemBlock
|
|||
|
||||
if (world.setBlock(x, y, z, this.getBlockID(), itemStack.getItemDamage(), 3))
|
||||
{
|
||||
if (itemStack.getItemDamage() == 13 && world.getBlockMaterial(x, y + 1, z).isReplaceable())
|
||||
world.setBlock(x, y + 1, z, this.getBlockID(), SUNFLOWERTOP, 2);
|
||||
|
||||
if (world.getBlockId(x, y, z) == this.getBlockID())
|
||||
{
|
||||
Block.blocksList[this.getBlockID()].onBlockPlacedBy(world, x, y, z, player, itemStack);
|
||||
|
|
43
src/minecraft/biomesoplenty/worldgen/WorldGenSunflower.java
Normal file
43
src/minecraft/biomesoplenty/worldgen/WorldGenSunflower.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
package biomesoplenty.worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import biomesoplenty.api.Blocks;
|
||||
import biomesoplenty.configuration.BOPBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenSunflower extends WorldGenerator
|
||||
{
|
||||
/** The ID of the plant block used in this plant generator. */
|
||||
private int plantBlockId;
|
||||
private int plantBlockMeta;
|
||||
|
||||
public WorldGenSunflower(int par1, int meta)
|
||||
{
|
||||
this.plantBlockId = par1;
|
||||
this.plantBlockMeta = meta;
|
||||
}
|
||||
|
||||
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||
{
|
||||
for (int l = 0; l < 64; ++l)
|
||||
{
|
||||
int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
|
||||
int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
|
||||
int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
|
||||
|
||||
if (par1World.isAirBlock(i1, j1, k1) && (!par1World.provider.hasNoSky || j1 < 127) && (par1World.getFullBlockLightValue(i1, j1, k1) >= 8 || par1World.canBlockSeeTheSky(i1, j1, k1))
|
||||
&& Block.blocksList[this.plantBlockId].canPlaceBlockOnSide(par1World, i1, j1, k1, 1, new ItemStack(this.plantBlockId, 1, this.plantBlockMeta)))
|
||||
{
|
||||
par1World.setBlock(i1, j1, k1, Blocks.flowers.get().blockID, 13, 2);
|
||||
par1World.setBlock(i1, j1 + 1, k1, Blocks.flowers.get().blockID, 14, 2);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 272 B |
Binary file not shown.
After Width: | Height: | Size: 353 B |
Binary file not shown.
After Width: | Height: | Size: 290 B |
Binary file not shown.
After Width: | Height: | Size: 373 B |
Loading…
Reference in a new issue