mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Doors fall when the block below is removed
This commit is contained in:
parent
19112f0d06
commit
49b7f60662
@ -25,6 +25,19 @@ class DoorBlock extends TransparentBlock{
|
||||
$this->isSolid = false;
|
||||
}
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
||||
$this->level->setBlock($this, new AirBlock(), false);
|
||||
if($this->getSide(1) instanceof DoorBlock){
|
||||
$this->level->setBlock($this->getSide(1), new AirBlock(), false);
|
||||
}
|
||||
return BLOCK_UPDATE_NORMAL;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($face === 1){
|
||||
$blockUp = $this->getSide(1);
|
||||
|
@ -24,19 +24,6 @@ class IronDoorBlock extends DoorBlock{
|
||||
parent::__construct(IRON_DOOR_BLOCK, $meta, "Iron Door Block");
|
||||
//$this->isActivable = true;
|
||||
}
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
||||
$this->level->setBlock($this, new AirBlock(), false);
|
||||
if($this->getSide(1) instanceof DoorBlock){
|
||||
$this->level->setBlock($this->getSide(1), new AirBlock(), false);
|
||||
}
|
||||
return BLOCK_UPDATE_NORMAL;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getBreakTime(Item $item, Player $player){
|
||||
if(($player->gamemode & 0x01) === 0x01){
|
||||
|
Loading…
x
Reference in New Issue
Block a user