mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
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:
parent
2e5e016b87
commit
3bd94c9da7
@ -52,6 +52,7 @@ class MobHead extends Flowable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
|
//TODO: different bounds depending on attached face (meta)
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + 0.25,
|
$this->x + 0.25,
|
||||||
$this->y,
|
$this->y,
|
||||||
@ -89,25 +90,6 @@ class MobHead extends Flowable{
|
|||||||
return false;
|
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){
|
public function getDrops(Item $item){
|
||||||
$tile = $this->level->getTile($this);
|
$tile = $this->level->getTile($this);
|
||||||
if($tile instanceof SkullTile){
|
if($tile instanceof SkullTile){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user