This commit is contained in:
Adubbz 2013-05-17 17:19:47 +10:00
commit 7552149aae
66 changed files with 1270 additions and 295 deletions

View file

@ -6,7 +6,9 @@ Pinecone: Pinecone that grows under spruce and fir leaves. No use yet.
Coconut: Grows on palm trees. Drops 2 coconut halves when broken with an axe. Coconut: Grows on palm trees. Drops 2 coconut halves when broken with an axe.
Berry Bush: Drops a berry when broken or right clicked. Origin Blocks: Planks, Gravel, Cobblestone, Mossy Cobblestone, Bricks, Block of Diamond, Block of Gold, Block of Iron, Lapis Lazuli Block
Originator: Used to turn certain blocks into previous forms. Requires Origin Essence to use.
--- ---
@ -14,8 +16,6 @@ ITEMS:
Coconut Halves: Coconuts drop 2 when broken with an axe. Restores 2 hunger points each. Coconut Halves: Coconuts drop 2 when broken with an axe. Restores 2 hunger points each.
Berry: Dropped from berry bushes. Restores 1/2 a hunger point.
--- ---
NETHER BIOMES: NETHER BIOMES:

View file

@ -1,4 +1,4 @@
- Redo the Promised Land portal, allowing for multiple portals. - Redo the Promised Land portal, allowing for multiple portals.
- Fix darts moving too fast and doing too much damage. - Add the Originator and Origin ____ blocks.
- Reduce excessive amounts of mobs in the Promised Lands. - Add Nether biomes.
- Fix sunflowers and lilyflowers dropping clovers. - Add other planned features.

View file

@ -28,7 +28,7 @@ public class ClientProxy extends CommonProxy {
{ {
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(Items.mudball.get(), 0)); RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(Items.mudball.get(), 0));
RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, new RenderDart()); RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, new RenderDart());
RenderingRegistry.registerEntityRenderingHandler(EntityPoisonDart.class, new RenderPoisonDart()); //RenderingRegistry.registerEntityRenderingHandler(EntityPoisonDart.class, new RenderPoisonDart());
RenderingRegistry.registerEntityRenderingHandler(EntityGlob.class, new RenderGlob(new ModelSlime(16), new ModelSlime(0), 0.25F)); RenderingRegistry.registerEntityRenderingHandler(EntityGlob.class, new RenderGlob(new ModelSlime(16), new ModelSlime(0), 0.25F));
@ -46,7 +46,7 @@ public class ClientProxy extends CommonProxy {
else if (string == "dart") else if (string == "dart")
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.dart.get(), mc.renderEngine); entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.dart.get(), mc.renderEngine);
else if (string == "dandelion") else if (string == "dandelion")
entityfx = new EntityDandelionFX(mc.theWorld, x, y, z, 1.0F); entityfx = new EntityDandelionFX(mc.theWorld, x, y, z, 2.0F);
mc.effectRenderer.addEffect(entityfx); mc.effectRenderer.addEffect(entityfx);
} }

View file

@ -32,6 +32,8 @@ public class Items
public static Optional<? extends Item> ancientStaff = Optional.absent(); public static Optional<? extends Item> ancientStaff = Optional.absent();
public static Optional<? extends Item> enderporter = Optional.absent(); public static Optional<? extends Item> enderporter = Optional.absent();
public static Optional<? extends Item> shroomPowder = Optional.absent(); public static Optional<? extends Item> shroomPowder = Optional.absent();
public static Optional<? extends Item> sunflowerSeeds = Optional.absent();
public static Optional<? extends Item> berries = Optional.absent();
public static Optional<? extends Item> miscItems = Optional.absent(); public static Optional<? extends Item> miscItems = Optional.absent();
public static Optional<? extends Item> mudball = Optional.absent(); public static Optional<? extends Item> mudball = Optional.absent();
public static Optional<? extends Item> poison = Optional.absent(); public static Optional<? extends Item> poison = Optional.absent();

View file

@ -176,6 +176,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected WorldGenerator potatoGen; protected WorldGenerator potatoGen;
protected WorldGenerator sproutGen; protected WorldGenerator sproutGen;
protected WorldGenerator bushGen; protected WorldGenerator bushGen;
protected WorldGenerator berryBushGen;
protected WorldGenerator tinyCactusGen; protected WorldGenerator tinyCactusGen;
protected WorldGenerator aloeGen; protected WorldGenerator aloeGen;
protected WorldGenerator deathbloomGen; protected WorldGenerator deathbloomGen;
@ -252,6 +253,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
protected int glowshroomsPerChunk; protected int glowshroomsPerChunk;
protected int sproutsPerChunk; protected int sproutsPerChunk;
protected int bushesPerChunk; protected int bushesPerChunk;
protected int berryBushesPerChunk;
protected int tinyCactiPerChunk; protected int tinyCactiPerChunk;
protected int aloePerChunk; protected int aloePerChunk;
protected int deathbloomsPerChunk; protected int deathbloomsPerChunk;
@ -390,6 +392,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.plantDesertGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 1); this.plantDesertGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 1);
this.thornGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 5); this.thornGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 5);
this.bushGen = new WorldGenBush(Blocks.foliage.get().blockID, 4); this.bushGen = new WorldGenBush(Blocks.foliage.get().blockID, 4);
this.berryBushGen = new WorldGenBOPFlowers(Blocks.foliage.get().blockID, 8);
this.tinyCactusGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 11); this.tinyCactusGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 11);
this.aloeGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 12); this.aloeGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 12);
this.lilyflowerGen = new WorldGenLilyflower(); this.lilyflowerGen = new WorldGenLilyflower();
@ -471,6 +474,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.sunflowersPerChunk = 0; this.sunflowersPerChunk = 0;
this.sproutsPerChunk = 0; this.sproutsPerChunk = 0;
this.bushesPerChunk = 0; this.bushesPerChunk = 0;
this.berryBushesPerChunk = 0;
this.tinyCactiPerChunk = 0; this.tinyCactiPerChunk = 0;
this.poisonIvyPerChunk = 0; this.poisonIvyPerChunk = 0;
this.aloePerChunk = 0; this.aloePerChunk = 0;
@ -897,6 +901,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.bushGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5); this.bushGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
} }
for (var2 = 0; var2 < this.berryBushesPerChunk; ++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.berryBushGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < this.poisonIvyPerChunk; ++var2) for (var2 = 0; var2 < this.poisonIvyPerChunk; ++var2)
{ {
var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8;

View file

@ -27,6 +27,7 @@ public class BiomeGenChaparral extends BiomeGenBase
this.customBiomeDecorator.treesPerChunk = 8; this.customBiomeDecorator.treesPerChunk = 8;
this.customBiomeDecorator.grassPerChunk = 20; this.customBiomeDecorator.grassPerChunk = 20;
this.customBiomeDecorator.bushesPerChunk = 10; this.customBiomeDecorator.bushesPerChunk = 10;
this.customBiomeDecorator.berryBushesPerChunk = 2;
this.customBiomeDecorator.generateStoneInGrass = true; this.customBiomeDecorator.generateStoneInGrass = true;
this.customBiomeDecorator.generatePumpkins = false; this.customBiomeDecorator.generatePumpkins = false;
} }

View file

@ -23,7 +23,7 @@ public class BiomeGenCherryBlossomGrove extends BiomeGenBase
this.customBiomeDecorator.whiteFlowersPerChunk = 30; this.customBiomeDecorator.whiteFlowersPerChunk = 30;
this.customBiomeDecorator.tinyFlowersPerChunk = 25; this.customBiomeDecorator.tinyFlowersPerChunk = 25;
this.customBiomeDecorator.grassPerChunk = 15; this.customBiomeDecorator.grassPerChunk = 15;
this.customBiomeDecorator.lilyflowersPerChunk = 6; this.customBiomeDecorator.lilyflowersPerChunk = 9;
this.customBiomeDecorator.generatePumpkins = false; this.customBiomeDecorator.generatePumpkins = false;
} }

View file

@ -33,6 +33,7 @@ public class BiomeGenConiferousForest extends BiomeGenBase
this.customBiomeDecorator.violetsPerChunk = 2; this.customBiomeDecorator.violetsPerChunk = 2;
this.customBiomeDecorator.blueMilksPerChunk = 1; this.customBiomeDecorator.blueMilksPerChunk = 1;
this.customBiomeDecorator.poisonIvyPerChunk = 1; this.customBiomeDecorator.poisonIvyPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 1;
} }
/** /**

View file

@ -26,6 +26,7 @@ public class BiomeGenDeciduousForest extends BiomeGenBase
this.customBiomeDecorator.flowersPerChunk = -999; this.customBiomeDecorator.flowersPerChunk = -999;
this.customBiomeDecorator.toadstoolsPerChunk = 1; this.customBiomeDecorator.toadstoolsPerChunk = 1;
this.customBiomeDecorator.bushesPerChunk = 8; this.customBiomeDecorator.bushesPerChunk = 8;
this.customBiomeDecorator.berryBushesPerChunk = 2;
this.customBiomeDecorator.blueMilksPerChunk = 2; this.customBiomeDecorator.blueMilksPerChunk = 2;
this.customBiomeDecorator.poisonIvyPerChunk = 1; this.customBiomeDecorator.poisonIvyPerChunk = 1;
} }

View file

@ -2,8 +2,7 @@ package biomesoplenty.biomes;
import java.util.Random; import java.util.Random;
import biomesoplenty.worldgen.WorldGenTaiga5; import biomesoplenty.worldgen.WorldGenLargeTree;
import biomesoplenty.worldgen.WorldGenTaiga8;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenShrub; import net.minecraft.world.gen.feature.WorldGenShrub;
@ -20,8 +19,7 @@ public class BiomeGenField extends BiomeGenBase
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
this.customBiomeDecorator.treesPerChunk = 1; this.customBiomeDecorator.treesPerChunk = 1;
this.customBiomeDecorator.flowersPerChunk = 1; this.customBiomeDecorator.flowersPerChunk = 1;
this.customBiomeDecorator.grassPerChunk = 25; this.customBiomeDecorator.grassPerChunk = 999;
this.customBiomeDecorator.portobellosPerChunk = 2;
this.customBiomeDecorator.generatePumpkins = false; this.customBiomeDecorator.generatePumpkins = false;
} }
@ -30,7 +28,7 @@ public class BiomeGenField extends BiomeGenBase
*/ */
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{ {
return (WorldGenerator)(par1Random.nextInt(4) == 0 ? new WorldGenTaiga5(false) : (par1Random.nextInt(8) == 0 ? new WorldGenTaiga8(false) : (par1Random.nextInt(2) == 0 ? this.worldGeneratorTrees : new WorldGenShrub(0,0)))); return new WorldGenLargeTree(false);
} }
/** /**
@ -38,7 +36,7 @@ public class BiomeGenField extends BiomeGenBase
*/ */
public int getBiomeGrassColor() public int getBiomeGrassColor()
{ {
return 11186770; return 10878796;
} }
/** /**
@ -46,6 +44,6 @@ public class BiomeGenField extends BiomeGenBase
*/ */
public int getBiomeFoliageColor() public int getBiomeFoliageColor()
{ {
return 10467150; return 10878796;
} }
} }

View file

@ -28,6 +28,7 @@ public class BiomeGenForestNew extends BiomeGenBase
this.customBiomeDecorator.reedsBOPPerChunk = 5; this.customBiomeDecorator.reedsBOPPerChunk = 5;
this.customBiomeDecorator.poisonIvyPerChunk = 2; this.customBiomeDecorator.poisonIvyPerChunk = 2;
this.customBiomeDecorator.sunflowersPerChunk = 1; this.customBiomeDecorator.sunflowersPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 2;
} }
/** /**

View file

@ -2,8 +2,16 @@ package biomesoplenty.biomes;
import java.util.Random; import java.util.Random;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import biomesoplenty.worldgen.WorldGenPoplar;
import biomesoplenty.worldgen.WorldGenPoplar2;
import biomesoplenty.worldgen.WorldGenChaparral2;
import net.minecraft.block.Block;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenShrub; import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenGrove extends BiomeGenBase public class BiomeGenGrove extends BiomeGenBase
@ -17,10 +25,12 @@ public class BiomeGenGrove extends BiomeGenBase
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
this.customBiomeDecorator.treesPerChunk = 3; this.customBiomeDecorator.treesPerChunk = 3;
this.customBiomeDecorator.flowersPerChunk = 5; this.customBiomeDecorator.flowersPerChunk = 5;
this.customBiomeDecorator.grassPerChunk = 10; this.customBiomeDecorator.tinyFlowersPerChunk = 80;
this.customBiomeDecorator.sproutsPerChunk = 2; this.customBiomeDecorator.whiteFlowersPerChunk = 15;
this.customBiomeDecorator.poisonIvyPerChunk = 2; this.customBiomeDecorator.grassPerChunk = 8;
this.customBiomeDecorator.sproutsPerChunk = 1;
this.customBiomeDecorator.lilyflowersPerChunk = 3; this.customBiomeDecorator.lilyflowersPerChunk = 3;
this.customBiomeDecorator.berryBushesPerChunk = 2;
this.customBiomeDecorator.generatePumpkins = false; this.customBiomeDecorator.generatePumpkins = false;
} }
@ -29,16 +39,24 @@ public class BiomeGenGrove extends BiomeGenBase
*/ */
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{ {
return (WorldGenerator)(par1Random.nextInt(2) == 0 ? new WorldGenShrub(2,2) : this.worldGeneratorBigTree); return (WorldGenerator)(par1Random.nextInt(2) == 0 ? new WorldGenChaparral2() : par1Random.nextInt(3) == 0 ? new WorldGenPoplar2() : new WorldGenPoplar());
//return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenNorwaySpruce1() : new WorldGenNorwaySpruce2()); //return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenNorwaySpruce1() : new WorldGenNorwaySpruce2());
} }
/**
* Gets a WorldGen appropriate for this biome.
*/
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 1) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 2);
}
/** /**
* Provides the basic grass color based on the biome temperature and rainfall * Provides the basic grass color based on the biome temperature and rainfall
*/ */
public int getBiomeGrassColor() public int getBiomeGrassColor()
{ {
return 8298592; return 5341009;
} }
/** /**
@ -46,6 +64,6 @@ public class BiomeGenGrove extends BiomeGenBase
*/ */
public int getBiomeFoliageColor() public int getBiomeFoliageColor()
{ {
return 7445333; return 6396257;
} }
} }

View file

@ -22,6 +22,7 @@ public class BiomeGenHeathland extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 10; this.customBiomeDecorator.grassPerChunk = 10;
this.customBiomeDecorator.purpleFlowersPerChunk = 30; this.customBiomeDecorator.purpleFlowersPerChunk = 30;
this.customBiomeDecorator.deadBushPerChunk = 2; this.customBiomeDecorator.deadBushPerChunk = 2;
this.customBiomeDecorator.berryBushesPerChunk = 1;
this.customBiomeDecorator.generatePumpkins = false; this.customBiomeDecorator.generatePumpkins = false;
} }

View file

@ -19,6 +19,7 @@ public class BiomeGenMountain extends BiomeGenBase
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
this.customBiomeDecorator.treesPerChunk = 2; this.customBiomeDecorator.treesPerChunk = 2;
this.customBiomeDecorator.grassPerChunk = 3; this.customBiomeDecorator.grassPerChunk = 3;
this.customBiomeDecorator.berryBushesPerChunk = 3;
} }
/** /**

View file

@ -24,6 +24,7 @@ public class BiomeGenOrchard extends BiomeGenBase
this.customBiomeDecorator.portobellosPerChunk = 2; this.customBiomeDecorator.portobellosPerChunk = 2;
this.customBiomeDecorator.sunflowersPerChunk = 1; this.customBiomeDecorator.sunflowersPerChunk = 1;
this.customBiomeDecorator.lilyflowersPerChunk = 2; this.customBiomeDecorator.lilyflowersPerChunk = 2;
this.customBiomeDecorator.berryBushesPerChunk = 3;
} }
/** /**

View file

@ -25,6 +25,7 @@ public class BiomeGenPrairie extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 999; this.customBiomeDecorator.grassPerChunk = 999;
this.customBiomeDecorator.whiteFlowersPerChunk = 45; this.customBiomeDecorator.whiteFlowersPerChunk = 45;
this.customBiomeDecorator.portobellosPerChunk = 2; this.customBiomeDecorator.portobellosPerChunk = 2;
this.customBiomeDecorator.berryBushesPerChunk = 2;
} }
/** /**

View file

@ -23,6 +23,7 @@ public class BiomeGenRedwoodForest extends BiomeGenBase
this.customBiomeDecorator.treesPerChunk = 6; this.customBiomeDecorator.treesPerChunk = 6;
this.customBiomeDecorator.grassPerChunk = 16; this.customBiomeDecorator.grassPerChunk = 16;
this.customBiomeDecorator.bushesPerChunk = 4; this.customBiomeDecorator.bushesPerChunk = 4;
this.customBiomeDecorator.berryBushesPerChunk = 1;
this.customBiomeDecorator.generatePumpkins = false; this.customBiomeDecorator.generatePumpkins = false;
} }

View file

@ -33,7 +33,6 @@ public class BiomeGenSeasonalForest extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 8; this.customBiomeDecorator.grassPerChunk = 8;
this.customBiomeDecorator.flowersPerChunk = -999; this.customBiomeDecorator.flowersPerChunk = -999;
this.customBiomeDecorator.toadstoolsPerChunk = 4; this.customBiomeDecorator.toadstoolsPerChunk = 4;
this.customBiomeDecorator.poisonIvyPerChunk = 1;
} }
/** /**

View file

@ -25,6 +25,7 @@ public class BiomeGenSpruceWoods extends BiomeGenBase
this.customBiomeDecorator.grassPerChunk = 6; this.customBiomeDecorator.grassPerChunk = 6;
this.customBiomeDecorator.sproutsPerChunk = 3; this.customBiomeDecorator.sproutsPerChunk = 3;
this.customBiomeDecorator.poisonIvyPerChunk = 1; this.customBiomeDecorator.poisonIvyPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 3;
} }
/** /**

View file

@ -42,6 +42,7 @@ public class BiomeGenWetland extends BiomeGenBase
this.customBiomeDecorator.blueFlowersPerChunk = 6; this.customBiomeDecorator.blueFlowersPerChunk = 6;
this.customBiomeDecorator.blueMilksPerChunk = 1; this.customBiomeDecorator.blueMilksPerChunk = 1;
this.customBiomeDecorator.portobellosPerChunk = 1; this.customBiomeDecorator.portobellosPerChunk = 1;
this.customBiomeDecorator.berryBushesPerChunk = 1;
this.spawnableCreatureList.clear(); this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear(); this.spawnableWaterCreatureList.clear();
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3)); this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));

View file

@ -272,11 +272,11 @@ public class BlockBOPAppleLeaves extends BlockLeavesBase implements IShearable
if ((meta & 3) == 3) if ((meta & 3) == 3)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0)); this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 2 && world.rand.nextInt(2) == 0) else if ((meta & 3) == 2 && world.rand.nextInt(8) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0)); this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 1 && world.rand.nextInt(5) == 0) else if ((meta & 3) == 1 && world.rand.nextInt(16) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0)); this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 0 && world.rand.nextInt(10) == 0) else if ((meta & 3) == 0 && world.rand.nextInt(32) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0)); this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
} }

View file

@ -191,12 +191,12 @@ public class BlockBOPFlower extends BlockFlower
@Override @Override
public void onNeighborBlockChange(World world, int x, int y, int z, int neighborID) public void onNeighborBlockChange(World world, int x, int y, int z, int neighborID)
{ {
super.onNeighborBlockChange(world, x, y, z, neighborID); //super.onNeighborBlockChange(world, x, y, z, neighborID);
this.checkFlowerChange(world, x, y, z); this.checkFlowerChange(world, x, y, z);
if (world.getBlockMetadata(x, y, z) == SUNFLOWERTOP && world.getBlockId(x, y - 1, z) == this.blockID && world.getBlockMetadata(x, y - 1, z) != SUNFLOWERBOTTOM) if (world.getBlockMetadata(x, y, z) == SUNFLOWERTOP && world.getBlockId(x, y - 1, z) == this.blockID && world.getBlockMetadata(x, y - 1, z) != SUNFLOWERBOTTOM)
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
//if (world.getBlockMetadata(x, y, z) == CATTAILBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID) if (world.getBlockMetadata(x, y, z) == SUNFLOWERBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
// world.setBlock(x, y, z, this.blockID, 7, 2); world.setBlockToAir(x, y, z);
} }
@Override @Override

View file

@ -10,6 +10,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -25,6 +26,7 @@ import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.IShearable; import net.minecraftforge.common.IShearable;
import biomesoplenty.BiomesOPlenty; import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks; import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
import biomesoplenty.blocks.renderers.FoliageRenderer; import biomesoplenty.blocks.renderers.FoliageRenderer;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -240,6 +242,25 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
super.harvestBlock(world, player, x, y, z, meta); super.harvestBlock(world, player, x, y, z, meta);
} }
@Override
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
if (world.isRemote)
return false;
int meta = world.getBlockMetadata(x, y, z);
if (meta == 8)
{
world.setBlock(x, y, z, blockID, 4, 3);
EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(Items.berries.get(), 1, 0));
world.spawnEntityInWorld(entityitem);
entityitem.onCollideWithPlayer(player);
return true;
}
else
return false;
}
@Override @Override
public boolean isBlockReplaceable(World world, int x, int y, int z) public boolean isBlockReplaceable(World world, int x, int y, int z)
{ {

View file

@ -180,8 +180,8 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
this.checkFlowerChange(world, x, y, z); this.checkFlowerChange(world, x, y, z);
if (world.getBlockMetadata(x, y, z) == CATTAILTOP && world.getBlockId(x, y - 1, z) == this.blockID && world.getBlockMetadata(x, y - 1, z) != CATTAILBOTTOM) if (world.getBlockMetadata(x, y, z) == CATTAILTOP && world.getBlockId(x, y - 1, z) == this.blockID && world.getBlockMetadata(x, y - 1, z) != CATTAILBOTTOM)
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
//if (world.getBlockMetadata(x, y, z) == CATTAILBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID) if (world.getBlockMetadata(x, y, z) == CATTAILBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
// world.setBlock(x, y, z, this.blockID, 7, 2); world.setBlockToAir(x, y, z);;
} }
@Override @Override

View file

@ -264,7 +264,7 @@ public class BOPBlocks {
LanguageRegistry.addName(new ItemStack(Blocks.plants.get(),1,5), "Thorns"); LanguageRegistry.addName(new ItemStack(Blocks.plants.get(),1,5), "Thorns");
LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,3), "High Grass"); LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,3), "High Grass");
LanguageRegistry.addName(Blocks.ashStone.get(), "Ash Stone"); LanguageRegistry.addName(Blocks.ashStone.get(), "Ash Stone");
LanguageRegistry.addName(Blocks.hardIce.get(), "Hard Ice"); LanguageRegistry.addName(Blocks.hardIce.get(), "Hardened Ice");
LanguageRegistry.addName(new ItemStack(Blocks.leaves2.get(),1,2), "Maple Leaves"); LanguageRegistry.addName(new ItemStack(Blocks.leaves2.get(),1,2), "Maple Leaves");
LanguageRegistry.addName(new ItemStack(Blocks.leaves1.get(),1,7), "Orange Autumn Leaves"); LanguageRegistry.addName(new ItemStack(Blocks.leaves1.get(),1,7), "Orange Autumn Leaves");
LanguageRegistry.addName(new ItemStack(Blocks.leaves2.get(),1,1), "Pink Cherry Leaves"); LanguageRegistry.addName(new ItemStack(Blocks.leaves2.get(),1,1), "Pink Cherry Leaves");
@ -273,6 +273,7 @@ public class BOPBlocks {
LanguageRegistry.addName(new ItemStack(Blocks.leaves1.get(),1,4), "Dying Leaves"); LanguageRegistry.addName(new ItemStack(Blocks.leaves1.get(),1,4), "Dying Leaves");
LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,1), "Short Grass"); LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,1), "Short Grass");
LanguageRegistry.addName(Blocks.leavesFruit.get(), "Apple Leaves"); LanguageRegistry.addName(Blocks.leavesFruit.get(), "Apple Leaves");
LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,8), "Berry Bush");
LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,7), "Poison Ivy"); LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,7), "Poison Ivy");
LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,5), "Sprout"); LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,5), "Sprout");
LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,4), "Bush"); LanguageRegistry.addName(new ItemStack(Blocks.foliage.get(),1,4), "Bush");
@ -334,9 +335,9 @@ public class BOPBlocks {
LanguageRegistry.addName(new ItemStack(Blocks.plants.get(),1,3), "Dune Grass"); LanguageRegistry.addName(new ItemStack(Blocks.plants.get(),1,3), "Dune Grass");
LanguageRegistry.addName(new ItemStack(Blocks.plants.get(),1,2), "Desert Sprouts"); LanguageRegistry.addName(new ItemStack(Blocks.plants.get(),1,2), "Desert Sprouts");
LanguageRegistry.addName(new ItemStack(Blocks.colorizedSaplings.get(),1,1), "Mangrove Sapling"); LanguageRegistry.addName(new ItemStack(Blocks.colorizedSaplings.get(),1,1), "Mangrove Sapling");
LanguageRegistry.addName(Blocks.hardSand.get(), "Hard Sand"); LanguageRegistry.addName(Blocks.hardSand.get(), "Hardened Sand");
LanguageRegistry.addName(new ItemStack(Blocks.colorizedSaplings.get(),1,0), "Acacia Sapling"); LanguageRegistry.addName(new ItemStack(Blocks.colorizedSaplings.get(),1,0), "Acacia Sapling");
LanguageRegistry.addName(Blocks.hardDirt.get(), "Hard Dirt"); LanguageRegistry.addName(Blocks.hardDirt.get(), "Hardened Dirt");
// LanguageRegistry.addName(Blocks.holyGrass.get(), "Holy Grass"); // LanguageRegistry.addName(Blocks.holyGrass.get(), "Holy Grass");
LanguageRegistry.addName(new ItemStack(Blocks.holyGrass.get(), 1, 0), "Purified Grass"); LanguageRegistry.addName(new ItemStack(Blocks.holyGrass.get(), 1, 0), "Purified Grass");
LanguageRegistry.addName(new ItemStack(Blocks.holyGrass.get(), 1, 1), "Smoldering Grass"); LanguageRegistry.addName(new ItemStack(Blocks.holyGrass.get(), 1, 1), "Smoldering Grass");

View file

@ -184,6 +184,8 @@ public class BOPConfiguration {
//Item IDs //Item IDs
public static int shroomPowderID; public static int shroomPowderID;
public static int sunflowerSeedsID;
public static int berriesID;
public static int ancientStaffID; public static int ancientStaffID;
public static int enderporterID; public static int enderporterID;
@ -672,6 +674,8 @@ public class BOPConfiguration {
// Get Item ID's // Get Item ID's
shroomPowderID = config.getItem("Shroom Powder ID", 21001, null).getInt(); shroomPowderID = config.getItem("Shroom Powder ID", 21001, null).getInt();
sunflowerSeedsID = config.getItem("Sunflower Seeds ID", 21002, null).getInt();
berriesID = config.getItem("Berries ID", 21003, null).getInt();
ancientStaffID = config.getItem("Ancient Staff ID", 21006).getInt(); ancientStaffID = config.getItem("Ancient Staff ID", 21006).getInt();
enderporterID = config.getItem("Enderporter ID", 21007).getInt(); enderporterID = config.getItem("Enderporter ID", 21007).getInt();

View file

@ -39,6 +39,7 @@ public class BOPCrafting
GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 2, 7), new Object[] {new ItemStack(Blocks.moss.get(),1,0)}); GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 2, 7), new Object[] {new ItemStack(Blocks.moss.get(),1,0)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 2, 8), new Object[] {new ItemStack(Blocks.flowers.get(),1,9)}); GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 2, 8), new Object[] {new ItemStack(Blocks.flowers.get(),1,9)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 2, 9), new Object[] {new ItemStack(Blocks.flowers.get(),1,2)}); GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 2, 9), new Object[] {new ItemStack(Blocks.flowers.get(),1,2)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.sunflowerSeeds.get(), 4, 0), new Object[] {new ItemStack(Blocks.flowers.get(),1,13)});
//Brick stairs and slabs //Brick stairs and slabs
GameRegistry.addRecipe(new ItemStack(Blocks.stoneSingleSlab.get(), 6, 0), new Object[] {"RRR", 'R', new ItemStack(Blocks.redRock.get(),1,1)}); GameRegistry.addRecipe(new ItemStack(Blocks.stoneSingleSlab.get(), 6, 0), new Object[] {"RRR", 'R', new ItemStack(Blocks.redRock.get(),1,1)});

View file

@ -15,6 +15,7 @@ import biomesoplenty.api.Items;
import biomesoplenty.armor.ArmorAmethyst; import biomesoplenty.armor.ArmorAmethyst;
import biomesoplenty.armor.ArmorFlowerBand; import biomesoplenty.armor.ArmorFlowerBand;
import biomesoplenty.armor.ArmorMuddy; import biomesoplenty.armor.ArmorMuddy;
import biomesoplenty.items.ItemBerries;
import biomesoplenty.items.ItemBOP; import biomesoplenty.items.ItemBOP;
import biomesoplenty.items.ItemBOPAncientStaff; import biomesoplenty.items.ItemBOPAncientStaff;
import biomesoplenty.items.ItemBOPAxe; import biomesoplenty.items.ItemBOPAxe;
@ -29,6 +30,7 @@ import biomesoplenty.items.ItemDart;
import biomesoplenty.items.ItemDartBlower; import biomesoplenty.items.ItemDartBlower;
import biomesoplenty.items.ItemEnderporter; import biomesoplenty.items.ItemEnderporter;
import biomesoplenty.items.ItemShroomPowder; import biomesoplenty.items.ItemShroomPowder;
import biomesoplenty.items.ItemSunflowerSeeds;
import biomesoplenty.items.overrides.ItemShears; import biomesoplenty.items.overrides.ItemShears;
import com.google.common.base.Optional; import com.google.common.base.Optional;
@ -105,7 +107,9 @@ public class BOPItems {
private static void initializeItems() private static void initializeItems()
{ {
// Item declaration // Item declaration
Items.shroomPowder = Optional.of(new ItemShroomPowder(BOPConfiguration.shroomPowderID, 1, 0.5F, false)); Items.shroomPowder = Optional.of(new ItemShroomPowder(BOPConfiguration.shroomPowderID, 1, 0.1F, false));
Items.sunflowerSeeds = Optional.of(new ItemSunflowerSeeds(BOPConfiguration.sunflowerSeedsID, 2, 0.5F, false));
Items.berries = Optional.of(new ItemBerries(BOPConfiguration.berriesID, 3, 0.2F, false));
Items.miscItems = Optional.of(new ItemBOP(BOPConfiguration.miscItemsID)); Items.miscItems = Optional.of(new ItemBOP(BOPConfiguration.miscItemsID));
Items.mudball = Optional.of(new ItemBOPMudball(BOPConfiguration.mudballID)); Items.mudball = Optional.of(new ItemBOPMudball(BOPConfiguration.mudballID));
Items.dartBlower = Optional.of(new ItemDartBlower(BOPConfiguration.dartBlowerID)); Items.dartBlower = Optional.of(new ItemDartBlower(BOPConfiguration.dartBlowerID));
@ -144,6 +148,8 @@ public class BOPItems {
private static void registerNames() private static void registerNames()
{ {
LanguageRegistry.addName(Items.shroomPowder.get(), "Shroom Powder"); LanguageRegistry.addName(Items.shroomPowder.get(), "Shroom Powder");
LanguageRegistry.addName(Items.sunflowerSeeds.get(), "Sunflower Seeds");
LanguageRegistry.addName(Items.berries.get(), "Berries");
LanguageRegistry.addName(Items.mudball.get(), "Mud Ball"); LanguageRegistry.addName(Items.mudball.get(), "Mud Ball");
LanguageRegistry.addName(Items.dartBlower.get(), "Dart Blower"); LanguageRegistry.addName(Items.dartBlower.get(), "Dart Blower");
LanguageRegistry.addName(new ItemStack(Items.dart.get(), 1, 0), "Dart"); LanguageRegistry.addName(new ItemStack(Items.dart.get(), 1, 0), "Dart");

View file

@ -2,17 +2,15 @@ package biomesoplenty.helpers;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement; import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.AchievementPage; import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import biomesoplenty.api.Blocks; import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items; import biomesoplenty.api.Items;
import biomesoplenty.configuration.BOPConfiguration; import biomesoplenty.configuration.BOPConfiguration;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.common.registry.LanguageRegistry;
public class AchievementHelper public class AchievementHelper
@ -102,7 +100,7 @@ public class AchievementHelper
{ {
player.addStat(achMud, 1); player.addStat(achMud, 1);
} }
if (item.itemID == Blocks.flowers.get().blockID && item.getItemDamage() == 10) if (item.itemID == Blocks.mushrooms.get().blockID && item.getItemDamage() == 0)
{ {
player.addStat(achShroom, 1); player.addStat(achShroom, 1);
} }
@ -115,6 +113,9 @@ public class AchievementHelper
player.addStat(achMoss, 1); player.addStat(achMoss, 1);
} }
} }
if (item.itemID == Blocks.logs1.get().blockID || item.itemID == Blocks.logs2.get().blockID || (item.itemID == Blocks.logs3.get().blockID && item.getItemDamage() < 3))
player.addStat(AchievementList.mineWood, 1);
} }
private static void addAchievementDesc(String ach, String name, String desc) private static void addAchievementDesc(String ach, String name, String desc)

View file

@ -169,6 +169,8 @@ public class ThaumcraftIntegration {
ThaumcraftApi.registerObjectTag(getBID("tulip"), getBMeta("tulip"), (new ObjectTags()).add(EnumTag.FLOWER, 4)); ThaumcraftApi.registerObjectTag(getBID("tulip"), getBMeta("tulip"), (new ObjectTags()).add(EnumTag.FLOWER, 4));
ThaumcraftApi.registerObjectTag(getBID("aloe"), getBMeta("aloe"), (new ObjectTags()).add(EnumTag.FLOWER, 4).add(EnumTag.PLANT, 4)); ThaumcraftApi.registerObjectTag(getBID("aloe"), getBMeta("aloe"), (new ObjectTags()).add(EnumTag.FLOWER, 4).add(EnumTag.PLANT, 4));
ThaumcraftApi.registerObjectTag(getBID("clover"), getBMeta("clover"), (new ObjectTags()).add(EnumTag.FLOWER, 1).add(EnumTag.PLANT, 1)); ThaumcraftApi.registerObjectTag(getBID("clover"), getBMeta("clover"), (new ObjectTags()).add(EnumTag.FLOWER, 1).add(EnumTag.PLANT, 1));
ThaumcraftApi.registerObjectTag(getBID("lilyflower"), getBMeta("lilyflower"), (new ObjectTags()).add(EnumTag.FLOWER, 1).add(EnumTag.PLANT, 1).add(EnumTag.WATER, 1));
ThaumcraftApi.registerObjectTag(getBID("sunflower"), getBMeta("sunflower"), (new ObjectTags()).add(EnumTag.FLOWER, 1).add(EnumTag.PLANT, 1).add(EnumTag.LIGHT, 1));
} }

View file

@ -36,12 +36,19 @@ public class ItemBOP extends Item
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return items[itemStack.getItemDamage()]; int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= items.length)
meta = 0;
return items[meta];
} }
@Override @Override
public Icon getIconFromDamage(int meta) public Icon getIconFromDamage(int meta)
{ {
if (meta < 0 || meta >= textures.length)
meta = 0;
return textures[meta]; return textures[meta];
} }

View file

@ -22,6 +22,10 @@ public class ItemBOPAmethyst extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemstack) { public String getUnlocalizedName(ItemStack itemstack) {
return types[itemstack.getItemDamage() & 15]; int meta = itemstack.getItemDamage();
if (meta < 0 || meta >= types.length)
meta = 0;
return types[meta];
} }
} }

View file

@ -49,12 +49,19 @@ public class ItemBOPAncientStaff extends Item
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return parts[itemStack.getItemDamage()]; int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= parts.length)
meta = 0;
return parts[meta];
} }
@Override @Override
public Icon getIconFromDamage(int meta) public Icon getIconFromDamage(int meta)
{ {
if (meta < 0 || meta >= textures.length)
meta = 0;
return textures[meta]; return textures[meta];
} }

View file

@ -25,11 +25,13 @@ public class ItemBOPColorizedSapling extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(saplings[itemStack.getItemDamage()]).append("Sapling").toString(); int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= saplings.length)
meta = 0;
return (new StringBuilder()).append(saplings[meta]).append("Sapling").toString();
} }
@Override @Override
public Icon getIconFromDamage(int meta) public Icon getIconFromDamage(int meta)
{ {

View file

@ -45,7 +45,11 @@ public class ItemBOPFlower extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(plants[itemStack.getItemDamage()]).toString(); int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= plants.length)
meta = 0;
return plants[meta];
} }
@Override @Override
@ -84,9 +88,9 @@ public class ItemBOPFlower extends ItemBlock
if (par1ItemStack.getItemDamage() == 15) { if (par1ItemStack.getItemDamage() == 15) {
Vec3 vec = par3EntityPlayer.getLookVec(); Vec3 vec = par3EntityPlayer.getLookVec();
for (int p = 0; p < 20; ++p) for (int p = 0; p < 32; ++p)
{ {
BiomesOPlenty.proxy.spawnParticle("dandelion", par3EntityPlayer.posX + vec.xCoord, par3EntityPlayer.posY + vec.yCoord + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ + vec.zCoord); BiomesOPlenty.proxy.spawnParticle("dandelion", par3EntityPlayer.posX + (vec.xCoord / 2), par3EntityPlayer.posY + (vec.yCoord / 2) + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ + (vec.zCoord / 2));
}; };
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));

View file

@ -38,12 +38,13 @@ public class ItemBOPFoliage extends ItemColored
textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + foliageTypes[i]); textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + foliageTypes[i]);
textures[3] = iconRegister.registerIcon("BiomesOPlenty:item_highgrass"); textures[3] = iconRegister.registerIcon("BiomesOPlenty:item_highgrass");
textures[8] = iconRegister.registerIcon("BiomesOPlenty:item_berrybush");
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemStack, int par2) public int getColorFromItemStack(ItemStack itemStack, int par2)
{ {
if (itemStack.getItemDamage() == 3) if (itemStack.getItemDamage() == 3 || itemStack.getItemDamage() == 8)
return 16777215; return 16777215;
else else
return Blocks.foliage.get().getRenderColor(itemStack.getItemDamage()); return Blocks.foliage.get().getRenderColor(itemStack.getItemDamage());
@ -58,7 +59,11 @@ public class ItemBOPFoliage extends ItemColored
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(foliageTypes[itemStack.getItemDamage()]).toString(); int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= foliageTypes.length)
meta = 0;
return foliageTypes[meta];
} }
@Override @Override

View file

@ -22,6 +22,10 @@ public class ItemBOPGrass extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemstack) { public String getUnlocalizedName(ItemStack itemstack) {
return types[itemstack.getItemDamage() & 15]; int meta = itemstack.getItemDamage();
if (meta < 0 || meta >= types.length)
meta = 0;
return types[meta];
} }
} }

View file

@ -23,6 +23,10 @@ public class ItemBOPMud extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return types[itemStack.getItemDamage()]; int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
meta = 0;
return types[meta];
} }
} }

View file

@ -28,7 +28,11 @@ public class ItemBOPMushroom extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(plants[itemStack.getItemDamage()]).toString(); int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= plants.length)
meta = 0;
return plants[meta];
} }
@Override @Override

View file

@ -23,6 +23,10 @@ public class ItemBOPPetals extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(petals[itemStack.getItemDamage()]).toString(); int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= petals.length)
meta = 0;
return petals[meta];
} }
} }

View file

@ -23,6 +23,10 @@ public class ItemBOPPlank extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return woodTypes[itemStack.getItemDamage()]; int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= woodTypes.length)
meta = 0;
return woodTypes[meta];
} }
} }

View file

@ -43,7 +43,11 @@ public class ItemBOPPlant extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(plants[itemStack.getItemDamage()]).toString(); int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= plants.length)
meta = 0;
return plants[itemStack.getItemDamage()];
} }
@Override @Override

View file

@ -22,6 +22,10 @@ public class ItemBOPRedRock extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemstack) { public String getUnlocalizedName(ItemStack itemstack) {
return types[itemstack.getItemDamage() & 15]; int meta = itemstack.getItemDamage();
if (meta < 0 || meta >= types.length)
meta = 0;
return types[meta];
} }
} }

View file

@ -22,6 +22,10 @@ public class ItemBOPSkystone extends ItemBlock
@Override @Override
public String getUnlocalizedName(ItemStack itemstack) { public String getUnlocalizedName(ItemStack itemstack) {
return types[itemstack.getItemDamage() & 15]; int meta = itemstack.getItemDamage();
if (meta < 0 || meta >= types.length)
meta = 0;
return types[meta];
} }
} }

View file

@ -0,0 +1,21 @@
package biomesoplenty.items;
import biomesoplenty.BiomesOPlenty;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemFood;
import net.minecraft.potion.Potion;
public class ItemBerries extends ItemFood
{
public ItemBerries(int par1, int par2, float par3, boolean par4)
{
super(par1, par2, par3, par4);
setAlwaysEdible().setUnlocalizedName("berries");
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("BiomesOPlenty:berries");
}
}

View file

@ -24,6 +24,7 @@ public class ItemDart extends Item
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
} }
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override @Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{ {
@ -36,7 +37,11 @@ public class ItemDart extends Item
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(dartTypes[itemStack.getItemDamage()]).toString(); int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= dartTypes.length)
meta = 0;
return dartTypes[meta];
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View file

@ -1,17 +1,14 @@
package biomesoplenty.items; package biomesoplenty.items;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty; import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Items; import biomesoplenty.api.Items;
import biomesoplenty.items.projectiles.EntityDart; import biomesoplenty.items.projectiles.EntityDart;
import biomesoplenty.items.projectiles.EntityPoisonDart; import biomesoplenty.items.projectiles.EntityDart.DartType;
public class ItemDartBlower extends Item public class ItemDartBlower extends Item
{ {
@ -33,21 +30,43 @@ public class ItemDartBlower extends Item
{ {
boolean flag = par3EntityPlayer.capabilities.isCreativeMode; boolean flag = par3EntityPlayer.capabilities.isCreativeMode;
if (par3EntityPlayer.inventory.hasItem(Items.dart.get().itemID)) if (flag || par3EntityPlayer.inventory.hasItem(Items.dart.get().itemID))
{ {
//EntityArrow entitydart = new EntityArrow(par2World, par3EntityPlayer, 2.0F); //EntityArrow entitydart = new EntityArrow(par2World, par3EntityPlayer, 2.0F);
EntityDart entityDart = new EntityDart(par2World, par3EntityPlayer, 1.25F);
itemStack.damageItem(1, par3EntityPlayer); itemStack.damageItem(1, par3EntityPlayer);
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 2.0F / (1.0F * 0.4F + 1.2F) + 1.0F * 0.5F); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 2.0F / (1.0F * 0.4F + 1.2F) + 1.0F * 0.5F);
if (!flag) int slot = -1;
par3EntityPlayer.inventory.consumeInventoryItem(Items.dart.get().itemID); if (par3EntityPlayer.inventory.hasItemStack(new ItemStack(Items.dart.get().itemID, 1, 1)))
{
entityDart.setDartType(DartType.POISON);
if (!par2World.isRemote) for (int k = 0; k < par3EntityPlayer.inventory.mainInventory.length; ++k)
if (par3EntityPlayer.inventory.hasItemStack(new ItemStack(Items.dart.get().itemID, 1, 0))) if (par3EntityPlayer.inventory.mainInventory[k] != null && par3EntityPlayer.inventory.mainInventory[k].itemID == Items.dart.get().itemID && par3EntityPlayer.inventory.mainInventory[k].getItemDamage() == 1)
par2World.spawnEntityInWorld(new EntityDart(par2World, par3EntityPlayer, 1.0F)); {
else slot = k;
par2World.spawnEntityInWorld(new EntityPoisonDart(par2World, par3EntityPlayer, 1.0F)); break;
}
}
else if (par3EntityPlayer.inventory.hasItemStack(new ItemStack(Items.dart.get().itemID, 1, 0)))
{
entityDart.setDartType(DartType.NORMAL);
for (int k = 0; k < par3EntityPlayer.inventory.mainInventory.length; ++k)
if (par3EntityPlayer.inventory.mainInventory[k] != null && par3EntityPlayer.inventory.mainInventory[k].itemID == Items.dart.get().itemID && par3EntityPlayer.inventory.mainInventory[k].getItemDamage() == 0)
{
slot = k;
break;
}
}
if (!par2World.isRemote)
par2World.spawnEntityInWorld(entityDart);
if (!flag && slot >= 0)
par3EntityPlayer.inventory.decrStackSize(slot, 1);
} }
return itemStack; return itemStack;

View file

@ -0,0 +1,21 @@
package biomesoplenty.items;
import biomesoplenty.BiomesOPlenty;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemFood;
import net.minecraft.potion.Potion;
public class ItemSunflowerSeeds extends ItemFood
{
public ItemSunflowerSeeds(int par1, int par2, float par3, boolean par4)
{
super(par1, par2, par3, par4);
setAlwaysEdible().setUnlocalizedName("sunflowerSeeds");
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("BiomesOPlenty:sunflowerseeds");
}
}

View file

@ -3,10 +3,8 @@ package biomesoplenty.items.projectiles;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentThorns;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityArrow;
@ -24,17 +22,19 @@ import biomesoplenty.ClientProxy;
public class EntityDart extends EntityArrow public class EntityDart extends EntityArrow
{ {
public static enum DartType
{
NORMAL, POISON;
}
boolean isClient = BiomesOPlenty.proxy instanceof ClientProxy; boolean isClient = BiomesOPlenty.proxy instanceof ClientProxy;
private int xTile = -1; private int xTile = -1;
private int yTile = -1; private int yTile = -1;
private int zTile = -1; private int zTile = -1;
private int inTile = 0;
private int inData = 0;
private boolean inGround = false;
private int ticksInGround;
private int ticksInAir = 0; private int ticksInAir = 0;
private double damage = 0.1D; private int damage = 2;
private DartType type = DartType.NORMAL;
public EntityDart(World par1World) public EntityDart(World par1World)
{ {
@ -53,7 +53,7 @@ public class EntityDart extends EntityArrow
public void onUpdate() public void onUpdate()
{ {
super.onUpdate(); super.onEntityUpdate();
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{ {
@ -71,227 +71,211 @@ public class EntityDart extends EntityArrow
if (axisalignedbb != null && axisalignedbb.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) if (axisalignedbb != null && axisalignedbb.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ)))
{ {
this.inGround = true; this.setDead();
} }
} }
if (this.inGround) ++this.ticksInAir;
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, false, true);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null)
{ {
int j = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); }
if (j == this.inTile && k == this.inData) Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int l;
float f1;
for (l = 0; l < list.size(); ++l)
{
Entity entity1 = (Entity)list.get(l);
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
{ {
++this.ticksInGround; f1 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31);
if (this.ticksInGround == 1) if (movingobjectposition1 != null)
{ {
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
{
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).func_96122_a(entityplayer))
{
movingobjectposition = null;
}
}
float f2;
float f3;
if (movingobjectposition != null)
{
if (movingobjectposition.entityHit != null)
{
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
DamageSource damagesource = null;
if (this.shootingEntity == null)
{
damagesource = DamageSource.causeArrowDamage(this, this);
}
else
{
damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity);
}
if (this.type == DartType.POISON)
{
this.damage = 1;
if (movingobjectposition.entityHit instanceof EntityLiving)
((EntityLiving)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 100));
}
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, this.damage))
{
if (movingobjectposition.entityHit instanceof EntityLiving)
{
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
{
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(6, 0));
}
}
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.setDead(); this.setDead();
} }
else
{
this.motionX *= -0.10000000149011612D;
this.motionY *= -0.10000000149011612D;
this.motionZ *= -0.10000000149011612D;
this.rotationYaw += 180.0F;
this.prevRotationYaw += 180.0F;
this.ticksInAir = 0;
}
} }
else else
{ {
this.inGround = false; this.xTile = movingobjectposition.blockX;
this.motionX *= (double)(this.rand.nextFloat() * 0.2F); this.yTile = movingobjectposition.blockY;
this.motionY *= (double)(this.rand.nextFloat() * 0.2F); this.zTile = movingobjectposition.blockZ;
this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX));
this.ticksInGround = 0; this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY));
this.ticksInAir = 0; this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ));
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / (double)f2 * 0.05000000074505806D;
this.posY -= this.motionY / (double)f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D;
for (int p = 0; p < 16; ++p)
{
BiomesOPlenty.proxy.spawnParticle("dart", this.posX, this.posY, this.posZ);
}
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.setDead();
} }
} }
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float f4 = 0.99F;
f1 = 0.05F;
if (this.isInWater())
{
for (int j1 = 0; j1 < 4; ++j1)
{
f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
}
f4 = 0.8F;
}
this.motionX *= (double)f4;
this.motionY *= (double)f4;
this.motionZ *= (double)f4;
this.motionY -= (double)f1;
this.setPosition(this.posX, this.posY, this.posZ);
this.doBlockCollisions();
}
public void setDartType(DartType par1)
{
this.type = par1;
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
if (par1 == DartType.POISON)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
}
else else
{ {
++this.ticksInAir; this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, false, true);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null)
{
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int l;
float f1;
for (l = 0; l < list.size(); ++l)
{
Entity entity1 = (Entity)list.get(l);
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
{
f1 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null)
{
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
{
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).func_96122_a(entityplayer))
{
movingobjectposition = null;
}
}
float f2;
float f3;
if (movingobjectposition != null)
{
if (movingobjectposition.entityHit != null)
{
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
int i1 = MathHelper.ceiling_double_int((double)f2 * this.damage);
if (this.getIsCritical())
{
i1 += this.rand.nextInt(i1 / 2 + 2);
}
DamageSource damagesource = null;
if (this.shootingEntity == null)
{
damagesource = DamageSource.causeArrowDamage(this, this);
}
else
{
damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity);
}
if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman))
{
movingobjectposition.entityHit.setFire(5);
//movingobjectposition.entityHit.addPotionEffect(new PotionEffect(Potion.poison.id, 100));
}
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, i1))
{
if (movingobjectposition.entityHit instanceof EntityLiving)
{
EntityLiving entityliving = (EntityLiving)movingobjectposition.entityHit;
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
{
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(6, 0));
}
}
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.setDead();
}
else
{
this.motionX *= -0.10000000149011612D;
this.motionY *= -0.10000000149011612D;
this.motionZ *= -0.10000000149011612D;
this.rotationYaw += 180.0F;
this.prevRotationYaw += 180.0F;
this.ticksInAir = 0;
}
}
else
{
this.xTile = movingobjectposition.blockX;
this.yTile = movingobjectposition.blockY;
this.zTile = movingobjectposition.blockZ;
this.inTile = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY));
this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ));
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / (double)f2 * 0.05000000074505806D;
this.posY -= this.motionY / (double)f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D;
for (int p = 0; i < 16; ++i)
{
BiomesOPlenty.proxy.spawnParticle("dart", this.posX, this.posY, this.posZ);
}
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.setDead();
if (this.inTile != 0)
{
Block.blocksList[this.inTile].onEntityCollidedWithBlock(this.worldObj, this.xTile, this.yTile, this.zTile, this);
}
}
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float f4 = 0.99F;
f1 = 0.05F;
if (this.isInWater())
{
for (int j1 = 0; j1 < 4; ++j1)
{
f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
}
f4 = 0.8F;
}
this.motionX *= (double)f4;
this.motionY *= (double)f4;
this.motionZ *= (double)f4;
this.motionY -= (double)f1;
this.setPosition(this.posX, this.posY, this.posZ);
this.doBlockCollisions();
} }
} }
/**
* Whether the arrow has a stream of critical hit particles flying behind it.
*/
public boolean isPoisonous()
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
return (b0 & 1) != 0;
}
} }

View file

@ -1,23 +1,27 @@
package biomesoplenty.items.projectiles; package biomesoplenty.items.projectiles;
import biomesoplenty.BiomesOPlenty;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderDart extends Render public class RenderDart extends Render
{ {
public void renderArrow(EntityArrow par1EntityArrow, double par2, double par4, double par6, float par8, float par9) public void renderArrow(EntityDart par1EntityArrow, double par2, double par4, double par6, float par8, float par9)
{ {
this.loadTexture("/mods/BiomesOPlenty/textures/projectiles/dart.png"); if (!par1EntityArrow.isPoisonous())
this.loadTexture("/mods/BiomesOPlenty/textures/projectiles/dart.png");
else
this.loadTexture("/mods/BiomesOPlenty/textures/projectiles/poisondart.png");
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6); GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
@ -84,6 +88,6 @@ public class RenderDart extends Render
*/ */
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{ {
this.renderArrow((EntityArrow)par1Entity, par2, par4, par6, par8, par9); this.renderArrow((EntityDart)par1Entity, par2, par4, par6, par8, par9);
} }
} }

View file

@ -18,12 +18,12 @@ public class EntityDandelionFX extends EntityFX {
public EntityDandelionFX(World par1World, double par2, double par4, double par6, float par8) public EntityDandelionFX(World par1World, double par2, double par4, double par6, float par8)
{ {
super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D; this.motionX *= 0.20000000149011612D;
this.motionY *= 0.10000000149011612D; this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D; this.motionZ *= 0.20000000149011612D;
float f4 = (float)Math.random() * 0.4F + 0.6F; float f4 = (float)Math.random() * 0.4F + 0.6F;
this.particleScale *= 0.75F; this.particleScale *= 0.25F;
this.particleScale *= par8; this.particleScale *= par8;
this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
this.particleMaxAge = (int)((float)this.particleMaxAge * par8); this.particleMaxAge = (int)((float)this.particleMaxAge * par8);
@ -56,7 +56,8 @@ public class EntityDandelionFX extends EntityFX {
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX); float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX);
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY); float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY);
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ); float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ);
float var16 = 1.2F - (float)Math.random() * 0.5F; //float var16 = 1.2F - (float)Math.random() * 0.5F;
float var16 = 1.2F * 0.5F;
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, 1.0F); par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, 1.0F);
par1Tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); par1Tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D);
par1Tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); par1Tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D);

View file

@ -0,0 +1,518 @@
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.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenLargeTree extends WorldGenerator
{
/**
* Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0
* and 2 for 1, and 0 and 1 for 2.
*/
static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1};
/** random seed for GenBigTree */
Random rand = new Random();
/** Reference to the World object. */
World worldObj;
int[] basePos = new int[] {0, 0, 0};
int heightLimit = 0;
int height;
double heightAttenuation = 0.45D;
double branchDensity = 1.0D;
double branchSlope = 0.0D;
double scaleWidth = 2.0D;
double leafDensity = 1.0D;
/**
* Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees.
*/
int trunkSize = 2;
/**
* Sets the limit of the random value used to initialize the height limit.
*/
int heightLimitLimit = 12;
/**
* Sets the distance limit for how far away the generator will populate leaves from the base leaf node.
*/
int leafDistanceLimit = 4;
/** Contains a list of a points at which to generate groups of leaves. */
int[][] leafNodes;
public WorldGenLargeTree(boolean par1)
{
super(par1);
}
/**
* Generates a list of leaf nodes for the tree, to be populated by generateLeaves.
*/
void generateLeafNodeList()
{
this.height = (int)((double)this.heightLimit * this.heightAttenuation);
if (this.height >= this.heightLimit)
{
this.height = this.heightLimit - 1;
}
int var1 = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D));
if (var1 < 1)
{
var1 = 1;
}
int[][] var2 = new int[var1 * this.heightLimit][4];
int var3 = this.basePos[1] + this.heightLimit - this.leafDistanceLimit;
int var4 = 1;
int var5 = this.basePos[1] + this.height;
int var6 = var3 - this.basePos[1];
var2[0][0] = this.basePos[0];
var2[0][1] = var3;
var2[0][2] = this.basePos[2];
var2[0][3] = var5;
--var3;
while (var6 >= 0)
{
int var7 = 0;
float var8 = this.layerSize(var6);
if (var8 < 0.0F)
{
--var3;
--var6;
}
else
{
for (double var9 = 0.5D; var7 < var1; ++var7)
{
double var11 = this.scaleWidth * (double)var8 * ((double)this.rand.nextFloat() + 0.328D);
double var13 = (double)this.rand.nextFloat() * 2.0D * Math.PI;
int var15 = MathHelper.floor_double(var11 * Math.sin(var13) + (double)this.basePos[0] + var9);
int var16 = MathHelper.floor_double(var11 * Math.cos(var13) + (double)this.basePos[2] + var9);
int[] var17 = new int[] {var15, var3, var16};
int[] var18 = new int[] {var15, var3 + this.leafDistanceLimit, var16};
if (this.checkBlockLine(var17, var18) == -1)
{
int[] var19 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]};
double var20 = Math.sqrt(Math.pow((double)Math.abs(this.basePos[0] - var17[0]), 2.0D) + Math.pow((double)Math.abs(this.basePos[2] - var17[2]), 2.0D));
double var22 = var20 * this.branchSlope;
if ((double)var17[1] - var22 > (double)var5)
{
var19[1] = var5;
}
else
{
var19[1] = (int)((double)var17[1] - var22);
}
if (this.checkBlockLine(var19, var17) == -1)
{
var2[var4][0] = var15;
var2[var4][1] = var3;
var2[var4][2] = var16;
var2[var4][3] = var19[1];
++var4;
}
}
}
--var3;
--var6;
}
}
this.leafNodes = new int[var4][4];
System.arraycopy(var2, 0, this.leafNodes, 0, var4);
}
void genTreeLayer(int par1, int par2, int par3, float par4, byte par5, int par6)
{
int var7 = (int)((double)par4 + 0.618D);
byte var8 = otherCoordPairs[par5];
byte var9 = otherCoordPairs[par5 + 3];
int[] var10 = new int[] {par1, par2, par3};
int[] var11 = new int[] {0, 0, 0};
int var12 = -var7;
int var13 = -var7;
for (var11[par5] = var10[par5]; var12 <= var7; ++var12)
{
var11[var8] = var10[var8] + var12;
var13 = -var7;
while (var13 <= var7)
{
double var15 = Math.pow((double)Math.abs(var12) + 0.5D, 2.0D) + Math.pow((double)Math.abs(var13) + 0.5D, 2.0D);
if (var15 > (double)(par4 * par4))
{
++var13;
}
else
{
var11[var9] = var10[var9] + var13;
int var14 = this.worldObj.getBlockId(var11[0], var11[1], var11[2]);
if (var14 != 0 && var14 != Block.leaves.blockID)
{
++var13;
}
else
{
this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], par6, 0);
++var13;
}
}
}
}
}
/**
* Gets the rough size of a layer of the tree.
*/
float layerSize(int par1)
{
if ((double)par1 < (double)((float)this.heightLimit) * 0.3D)
{
return -1.618F;
}
else
{
float var2 = (float)this.heightLimit / 2.0F;
float var3 = (float)this.heightLimit / 2.0F - (float)par1;
float var4;
if (var3 == 0.0F)
{
var4 = var2;
}
else if (Math.abs(var3) >= var2)
{
var4 = 0.0F;
}
else
{
var4 = (float)Math.sqrt(Math.pow((double)Math.abs(var2), 2.0D) - Math.pow((double)Math.abs(var3), 2.0D));
}
var4 *= 0.5F;
return var4;
}
}
float leafSize(int par1)
{
return par1 >= 0 && par1 < this.leafDistanceLimit ? (par1 != 0 && par1 != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F;
}
/**
* Generates the leaves surrounding an individual entry in the leafNodes list.
*/
void generateLeafNode(int par1, int par2, int par3)
{
int var4 = par2;
for (int var5 = par2 + this.leafDistanceLimit; var4 < var5; ++var4)
{
float var6 = this.leafSize(var4 - par2);
this.genTreeLayer(par1, var4, par3, var6, (byte)1, Block.leaves.blockID);
}
}
/**
* Places a line of the specified block ID into the world from the first coordinate triplet to the second.
*/
void placeBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, int par3)
{
int[] var4 = new int[] {0, 0, 0};
byte var5 = 0;
byte var6;
for (var6 = 0; var5 < 3; ++var5)
{
var4[var5] = par2ArrayOfInteger[var5] - par1ArrayOfInteger[var5];
if (Math.abs(var4[var5]) > Math.abs(var4[var6]))
{
var6 = var5;
}
}
if (var4[var6] != 0)
{
byte var7 = otherCoordPairs[var6];
byte var8 = otherCoordPairs[var6 + 3];
byte var9;
if (var4[var6] > 0)
{
var9 = 1;
}
else
{
var9 = -1;
}
double var10 = (double)var4[var7] / (double)var4[var6];
double var12 = (double)var4[var8] / (double)var4[var6];
int[] var14 = new int[] {0, 0, 0};
int var15 = 0;
for (int var16 = var4[var6] + var9; var15 != var16; var15 += var9)
{
var14[var6] = MathHelper.floor_double((double)(par1ArrayOfInteger[var6] + var15) + 0.5D);
var14[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var15 * var10 + 0.5D);
var14[var8] = MathHelper.floor_double((double)par1ArrayOfInteger[var8] + (double)var15 * var12 + 0.5D);
byte var17 = 0;
int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]);
int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]);
int var20 = Math.max(var18, var19);
if (var20 > 0)
{
if (var18 == var20)
{
var17 = 4;
}
else if (var19 == var20)
{
var17 = 8;
}
}
this.setBlockAndMetadata(this.worldObj, var14[0], var14[1], var14[2], par3, var17);
}
}
}
/**
* Generates the leaf portion of the tree as specified by the leafNodes list.
*/
void generateLeaves()
{
int var1 = 0;
for (int var2 = this.leafNodes.length; var1 < var2; ++var1)
{
int var3 = this.leafNodes[var1][0];
int var4 = this.leafNodes[var1][1];
int var5 = this.leafNodes[var1][2];
this.generateLeafNode(var3, var4, var5);
}
}
/**
* Indicates whether or not a leaf node requires additional wood to be added to preserve integrity.
*/
boolean leafNodeNeedsBase(int par1)
{
return (double)par1 >= (double)this.heightLimit * 0.2D;
}
/**
* Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a
* field that is always 1 to 2.
*/
void generateTrunk()
{
int var1 = this.basePos[0];
int var2 = this.basePos[1];
int var3 = this.basePos[1] + this.height;
int var4 = this.basePos[2];
int[] var5 = new int[] {var1, var2, var4};
int[] var6 = new int[] {var1, var3, var4};
this.placeBlockLine(var5, var6, Block.wood.blockID);
if (this.trunkSize == 2)
{
++var5[0];
++var6[0];
this.placeBlockLine(var5, var6, Block.wood.blockID);
++var5[2];
++var6[2];
this.placeBlockLine(var5, var6, Block.wood.blockID);
var5[0] += -1;
var6[0] += -1;
this.placeBlockLine(var5, var6, Block.wood.blockID);
}
}
/**
* Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade.
*/
void generateLeafNodeBases()
{
int var1 = 0;
int var2 = this.leafNodes.length;
for (int[] var3 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; var1 < var2; ++var1)
{
int[] var4 = this.leafNodes[var1];
int[] var5 = new int[] {var4[0], var4[1], var4[2]};
var3[1] = var4[3];
int var6 = var3[1] - this.basePos[1];
if (this.leafNodeNeedsBase(var6))
{
this.placeBlockLine(var3, var5, Block.wood.blockID);
}
}
}
/**
* Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance
* (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered.
*/
int checkBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger)
{
int[] var3 = new int[] {0, 0, 0};
byte var4 = 0;
byte var5;
for (var5 = 0; var4 < 3; ++var4)
{
var3[var4] = par2ArrayOfInteger[var4] - par1ArrayOfInteger[var4];
if (Math.abs(var3[var4]) > Math.abs(var3[var5]))
{
var5 = var4;
}
}
if (var3[var5] == 0)
{
return -1;
}
else
{
byte var6 = otherCoordPairs[var5];
byte var7 = otherCoordPairs[var5 + 3];
byte var8;
if (var3[var5] > 0)
{
var8 = 1;
}
else
{
var8 = -1;
}
double var9 = (double)var3[var6] / (double)var3[var5];
double var11 = (double)var3[var7] / (double)var3[var5];
int[] var13 = new int[] {0, 0, 0};
int var14 = 0;
int var15;
for (var15 = var3[var5] + var8; var14 != var15; var14 += var8)
{
var13[var5] = par1ArrayOfInteger[var5] + var14;
var13[var6] = MathHelper.floor_double((double)par1ArrayOfInteger[var6] + (double)var14 * var9);
var13[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var14 * var11);
int var16 = this.worldObj.getBlockId(var13[0], var13[1], var13[2]);
if (var16 != 0 && var16 != Block.leaves.blockID)
{
break;
}
}
return var14 == var15 ? -1 : Math.abs(var14);
}
}
/**
* Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height
* limit, is valid.
*/
boolean validTreeLocation()
{
int[] var1 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]};
int[] var2 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]};
int var3 = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePos[2]);
if (var3 != 2 && var3 != 3)
{
return false;
}
else
{
int var4 = this.checkBlockLine(var1, var2);
if (var4 == -1)
{
return true;
}
else if (var4 < 6)
{
return false;
}
else
{
this.heightLimit = var4;
return true;
}
}
}
/**
* Rescales the generator settings, only used in WorldGenBigTree
*/
public void setScale(double par1, double par3, double par5)
{
this.heightLimitLimit = (int)(par1 * 12.0D);
if (par1 > 0.5D)
{
this.leafDistanceLimit = 5;
}
this.scaleWidth = par3;
this.leafDensity = par5;
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
this.worldObj = par1World;
long var6 = par2Random.nextLong();
this.rand.setSeed(var6);
this.basePos[0] = par3;
this.basePos[1] = par4;
this.basePos[2] = par5;
if (this.heightLimit == 0)
{
this.heightLimit = 12 + par2Random.nextInt(10);
}
if (!this.validTreeLocation())
{
return false;
}
else
{
this.generateLeafNodeList();
this.generateLeaves();
this.generateTrunk();
this.generateLeafNodeBases();
return true;
}
}
}

View file

@ -0,0 +1,130 @@
package biomesoplenty.worldgen;
import java.util.Random;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenPoplar extends WorldGenerator
{
public boolean generate(World var1, Random var2, int var3, int var4, int var5)
{
while (var1.isAirBlock(var3, var4, var5) && var4 > 2)
{
--var4;
}
int var6 = var1.getBlockId(var3, var4, var5);
if (var6 != Block.grass.blockID)
{
return false;
}
else
{
for (int var7 = -2; var7 <= 2; ++var7)
{
for (int var8 = -2; var8 <= 2; ++var8)
{
if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8))
{
return false;
}
}
}
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
var1.setBlock(var3, var4 + 1, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 2, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 3, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 4, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 5, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 6, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 8, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 3, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 3, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 3, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 3, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 4, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 4, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 4, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 4, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 4, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 4, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 4, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 4, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 5, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 5, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 5, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 5, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 5, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 5, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 5, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 5, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 2, var4 + 5, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 2, var4 + 5, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 5, var5 + 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 5, var5 - 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 6, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 6, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 6, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 6, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 6, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 6, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 6, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 6, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 2, var4 + 6, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 2, var4 + 6, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 6, var5 + 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 6, var5 - 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 7, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 7, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 7, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 7, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 7, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 7, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 2, var4 + 7, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 2, var4 + 7, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5 + 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5 - 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 8, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 8, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 8, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 8, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 8, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 8, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 8, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 8, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 9, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 9, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 10, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 10, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 10, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 10, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 11, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 12, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 13, var5, Block.leaves.blockID, 1, 2);
return true;
}
}
}

View file

@ -0,0 +1,135 @@
package biomesoplenty.worldgen;
import java.util.Random;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenPoplar2 extends WorldGenerator
{
public boolean generate(World var1, Random var2, int var3, int var4, int var5)
{
while (var1.isAirBlock(var3, var4, var5) && var4 > 2)
{
--var4;
}
int var6 = var1.getBlockId(var3, var4, var5);
if (var6 != Block.grass.blockID)
{
return false;
}
else
{
for (int var7 = -2; var7 <= 2; ++var7)
{
for (int var8 = -2; var8 <= 2; ++var8)
{
if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8))
{
return false;
}
}
}
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
var1.setBlock(var3, var4 + 1, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 2, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 3, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 4, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 5, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 6, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 8, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 10, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 11, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 12, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 13, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3, var4 + 14, var5, Block.wood.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 7, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 7, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 7, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 8, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 8, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 8, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 8, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 8, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 8, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 8, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 8, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 9, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 9, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 9, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 9, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 9, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 9, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 2, var4 + 9, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 2, var4 + 9, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5 + 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 9, var5 - 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 10, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 10, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 10, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 10, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 10, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 10, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 10, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 10, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 2, var4 + 10, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 2, var4 + 10, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 10, var5 + 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 10, var5 - 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 11, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 11, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 11, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 11, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 11, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 11, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 11, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 11, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 2, var4 + 11, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 2, var4 + 11, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 11, var5 + 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 11, var5 - 2, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 12, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 12, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 12, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 12, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 12, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 12, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 12, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 12, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 13, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 13, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 13, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 13, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 + 1, var4 + 14, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3 - 1, var4 + 14, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 14, var5 + 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 14, var5 - 1, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 15, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 16, var5, Block.leaves.blockID, 1, 2);
var1.setBlock(var3, var4 + 17, var5, Block.leaves.blockID, 1, 2);
return true;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 B

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B