Heads do not drop when the supporting block is removed

https://github.com/PocketMine/PocketMine-MP/pull/4087 didn't get reviewed properly, or at all 🤦
This commit is contained in:
Dylan K. Taylor 2017-03-17 18:13:37 +00:00
parent 2e5e016b87
commit 3bd94c9da7

View File

@ -52,6 +52,7 @@ class MobHead extends Flowable{
}
protected function recalculateBoundingBox(){
//TODO: different bounds depending on attached face (meta)
return new AxisAlignedBB(
$this->x + 0.25,
$this->y,
@ -89,25 +90,6 @@ class MobHead extends Flowable{
return false;
}
public function onUpdate($type){
$faces = [
1 => 0,
2 => 3,
3 => 2,
4 => 5,
5 => 4,
];
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide($faces[$this->meta])->getId() === self::AIR){
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return parent::onUpdate($type);
}
public function getDrops(Item $item){
$tile = $this->level->getTile($this);
if($tile instanceof SkullTile){