summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockTNT.java
diff options
context:
space:
mode:
authorCeltic Minstrel <celtic.minstrel.ca@some.place>2012-03-05 14:21:43 -0500
committerEvilSeph <evilseph@gmail.com>2012-03-21 12:42:51 -0400
commit5ba892804158ba81b655826469363eefa8f0baaa (patch)
tree75daade710326db6487550877a21a8557951bc52 /src/main/java/net/minecraft/server/BlockTNT.java
parent8d62de7055a8c901240412ac41f3cb5091ea41a9 (diff)
downloadcraftbukkit-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/BlockTNT.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockTNT.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java
index f1efb135..e8261b55 100644
--- a/src/main/java/net/minecraft/server/BlockTNT.java
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
@@ -1,5 +1,6 @@
package net.minecraft.server;
+import java.util.ArrayList; // CraftBukkit
import java.util.Random;
public class BlockTNT extends Block {
@@ -41,7 +42,9 @@ public class BlockTNT extends Block {
public void postBreak(World world, int i, int j, int k, int l) {
if (!world.isStatic) {
if ((l & 1) == 0) {
+ /* CraftBukkit - Move this earlier so the block break event can see it
this.a(world, i, j, k, new ItemStack(Block.TNT.id, 1, 0));
+ // */
} else {
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F));
@@ -51,6 +54,14 @@ public class BlockTNT extends Block {
}
}
+ // CraftBukkit start - Calculate drops
+ public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
+ super.dropList = new ArrayList<ItemStack>();
+ this.a(world, i, j, k, new ItemStack(Block.TNT.id, 1, 0));
+ return super.dropList;
+ }
+ // CraftBukkit end
+
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
if (entityhuman.T() != null && entityhuman.T().id == Item.FLINT_AND_STEEL.id) {
world.setRawData(i, j, k, 1);