summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/Explosion.java
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-11-14 19:52:40 -0600
committerTravis Watkins <amaranth@ubuntu.com>2012-11-14 20:14:47 -0600
commitdf69ea8814a446502a0d096f542cbbb6879c80cd (patch)
tree24580b1924e964b2f40703bac0d0a867a92f09d2 /src/main/java/net/minecraft/server/Explosion.java
parent092800af2690a46fb36783f75b7575a3ece2745c (diff)
downloadcraftbukkit-df69ea8814a446502a0d096f542cbbb6879c80cd.tar
craftbukkit-df69ea8814a446502a0d096f542cbbb6879c80cd.tar.gz
craftbukkit-df69ea8814a446502a0d096f542cbbb6879c80cd.tar.lz
craftbukkit-df69ea8814a446502a0d096f542cbbb6879c80cd.tar.xz
craftbukkit-df69ea8814a446502a0d096f542cbbb6879c80cd.zip
Rework skull dropping. Fixes BUKKIT-2930 and BUKKIT-2820
Skulls need their tile entity in order to create an item correctly when broken unlike every other block. Instead of sprinkling special cases all over the code just override dropNaturally for skulls to read from their tile entity and make sure everything that wants to drop them calls this method before removing the block. There is only one case where this wasn't already true so we end up with much less special casing.
Diffstat (limited to 'src/main/java/net/minecraft/server/Explosion.java')
-rw-r--r--src/main/java/net/minecraft/server/Explosion.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index c91c9599..fae57de1 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -264,18 +264,13 @@ public class Explosion {
// CraftBukkit - stop explosions from putting out fire
if (l > 0 && l != Block.FIRE.id) {
- // CraftBukkit start - special case skulls, add yield
- int data = this.world.getData(i, j, k);
- if (l == Block.SKULL.id) {
- data = Block.SKULL.getDropData(this.world, i, j, k);
- }
-
Block block = Block.byId[l];
if (block.a(this)) {
- block.dropNaturally(this.world, i, j, k, data, event.getYield(), 0);
+ // CraftBukkit
+ block.dropNaturally(this.world, i, j, k, this.world.getData(i, j, k), event.getYield(), 0);
}
- // CraftBukkit end
+
if (this.world.setRawTypeIdAndData(i, j, k, 0, 0, this.world.isStatic)) {
this.world.applyPhysics(i, j, k, 0);
}