diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-03-05 14:21:43 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-21 12:42:51 -0400 |
commit | 5ba892804158ba81b655826469363eefa8f0baaa (patch) | |
tree | 75daade710326db6487550877a21a8557951bc52 /src/main/java/net/minecraft/server/BlockLongGrass.java | |
parent | 8d62de7055a8c901240412ac41f3cb5091ea41a9 (diff) | |
download | craftbukkit-5ba892804158ba81b655826469363eefa8f0baaa.tar craftbukkit-5ba892804158ba81b655826469363eefa8f0baaa.tar.gz craftbukkit-5ba892804158ba81b655826469363eefa8f0baaa.tar.lz craftbukkit-5ba892804158ba81b655826469363eefa8f0baaa.tar.xz craftbukkit-5ba892804158ba81b655826469363eefa8f0baaa.zip |
[Bleeding] Added getting and setting drops to all appropriate events. Fixes BUKKIT-397 and fixes BUKKIT-1252
- Allows drops in creative mode by adding items to the getDrops() list
- Contents of containers are not reported
- Contents of storage minecarts are not reported
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockLongGrass.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockLongGrass.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockLongGrass.java b/src/main/java/net/minecraft/server/BlockLongGrass.java index 2f192f54..b5875e16 100644 --- a/src/main/java/net/minecraft/server/BlockLongGrass.java +++ b/src/main/java/net/minecraft/server/BlockLongGrass.java @@ -1,5 +1,6 @@ package net.minecraft.server; +import java.util.ArrayList; // CraftBukkit import java.util.Random; public class BlockLongGrass extends BlockFlower { @@ -26,9 +27,25 @@ public class BlockLongGrass extends BlockFlower { 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); + /* CraftBukkit start - moved this line into calculateDrops this.a(world, i, j, k, new ItemStack(Block.LONG_GRASS, 1, l)); + */ + this.doActualDrop(world, entityhuman, i, j, k, l); + // CraftBukkit end } else { super.a(world, entityhuman, i, j, k, l); } } + + // CraftBukkit start - Calculate drops + public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) { + if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) { + super.dropList = new ArrayList<ItemStack>(); + this.a(world, i, j, k, new ItemStack(Block.LONG_GRASS, 1, l)); + return super.dropList; + } else { + return super.calculateDrops(world, entityhuman, i, j, k, l); + } + } + // CraftBukkit end } |