mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Get skull data before destroying block. Fixes BUKKIT-2723
Skull blocks store their type in a tile entity and use their block data as rotation. When breaking a block the block data is used for determining what item to drop. Simply changing this to use the skull method for getting their drop data is not enough because their tile entity is already gone. Therefore we have to special case skulls to get the correct data _and_ get that data before breaking the block.
This commit is contained in:
1 parent
14f4bd9024
commit
216cddb2ab
4 files changed
+30
-8
No files matched your search
@@ -264,8 +264,14 @@ public class Explosion {
|
||||
|
||||
// CraftBukkit - stop explosions from putting out fire
|
||||
if (l > 0 && l != Block.FIRE.id) {
|
||||
// CraftBukkit
|
||||
Block.byId[l].dropNaturally(this.world, i, j, k, this.world.getData(i, j, k), event.getYield(), 0);
|
||||
// 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.byId[l].dropNaturally(this.world, i, j, k, data, event.getYield(), 0);
|
||||
// CraftBukkit end
|
||||
if (this.world.setRawTypeIdAndData(i, j, k, 0, 0, this.world.isStatic)) {
|
||||
this.world.applyPhysics(i, j, k, 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user