Fixed beds not getting deleted properly in survival

the anti-instabreak kicked in twice... damned anti-cheat... luckily the player is not needed for this part
This commit is contained in:
Dylan K. Taylor 2017-10-09 10:49:30 +01:00
parent 7267f1a520
commit cebb4b35f6

View File

@ -209,7 +209,7 @@ class Bed extends Transparent{
public function onBreak(Item $item, Player $player = null) : bool{
$this->getLevel()->setBlock($this, BlockFactory::get(Block::AIR), true, true);
if(($other = $this->getOtherHalf()) !== null){
$this->getLevel()->useBreakOn($other, $item, $player, $player !== null); //make sure tiles get removed
$this->getLevel()->useBreakOn($other, $item, null, $player !== null); //make sure tiles get removed
}
return true;