Fixed Chests and Furnaces not droping their contents when broken

This commit is contained in:
Shoghi Cervantes
2014-05-28 15:34:34 +02:00
parent c778e0467e
commit 130b2c4910
3 changed files with 5 additions and 4 deletions

View File

@@ -756,6 +756,7 @@ class Level{
return false;
}
$drops = $target->getDrops($item); //Fixes tile entities being deleted before getting drops
$target->onBreak($item);
if($item instanceof Item){
$item->useOn($target);
@@ -765,7 +766,7 @@ class Level{
}
if(!($player instanceof Player) or ($player->getGamemode() & 0x01) === 0){
foreach($target->getDrops($item) as $drop){
foreach($drops as $drop){
if($drop[2] > 0){
$this->dropItem($vector->add(0.5, 0.5, 0.5), Item::get($drop[0], $drop[1], $drop[2]), 1);
}