diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-03-06 22:42:58 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-20 22:17:47 -0400 |
commit | 8d62de7055a8c901240412ac41f3cb5091ea41a9 (patch) | |
tree | 44418ce59c24bf122e32d8720dbd0979d39b8096 /src/main/java/net/minecraft/server/BlockLongGrass.java | |
parent | 784aa3b6026b2c765c65d2c461d3b791eca6b697 (diff) | |
download | craftbukkit-8d62de7055a8c901240412ac41f3cb5091ea41a9.tar craftbukkit-8d62de7055a8c901240412ac41f3cb5091ea41a9.tar.gz craftbukkit-8d62de7055a8c901240412ac41f3cb5091ea41a9.tar.lz craftbukkit-8d62de7055a8c901240412ac41f3cb5091ea41a9.tar.xz craftbukkit-8d62de7055a8c901240412ac41f3cb5091ea41a9.zip |
Added for diff visibility:
- BlockBed
- BlockDeadBush
- BlockLongGrass
- BlockVine
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockLongGrass.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockLongGrass.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockLongGrass.java b/src/main/java/net/minecraft/server/BlockLongGrass.java new file mode 100644 index 00000000..2f192f54 --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockLongGrass.java @@ -0,0 +1,34 @@ +package net.minecraft.server; + +import java.util.Random; + +public class BlockLongGrass extends BlockFlower { + + protected BlockLongGrass(int i, int j) { + super(i, j, Material.REPLACEABLE_PLANT); + float f = 0.4F; + + this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + } + + public int a(int i, int j) { + return j == 1 ? this.textureId : (j == 2 ? this.textureId + 16 + 1 : (j == 0 ? this.textureId + 16 : this.textureId)); + } + + public int getDropType(int i, Random random, int j) { + return random.nextInt(8) == 0 ? Item.SEEDS.id : -1; + } + + public int getDropCount(int i, Random random) { + return 1 + random.nextInt(i * 2 + 1); + } + + public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { + if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) { + entityhuman.a(StatisticList.C[this.id], 1); + this.a(world, i, j, k, new ItemStack(Block.LONG_GRASS, 1, l)); + } else { + super.a(world, entityhuman, i, j, k, l); + } + } +} |