mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
Cake is now broken if the bottom block is removed [MCPE-4661]
This commit is contained in:
parent
4156aad71f
commit
3779a66bdb
2 changed files with 23 additions and 0 deletions
|
|
@ -33,6 +33,16 @@ class CakeBlock extends TransparentBlock{
|
||||||
$this->meta = $meta & 0x07;
|
$this->meta = $meta & 0x07;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onUpdate($type){
|
||||||
|
if($type === BLOCK_UPDATE_NORMAL){
|
||||||
|
if($this->getSide(0)->getID() === AIR){ //Replace wit common break method
|
||||||
|
$this->level->setBlock($this, new AirBlock(), false);
|
||||||
|
return BLOCK_UPDATE_NORMAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,19 @@ class IronDoorBlock extends DoorBlock{
|
||||||
//$this->isActivable = true;
|
//$this->isActivable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onUpdate($type){
|
||||||
|
if($type === BLOCK_UPDATE_NORMAL){
|
||||||
|
if($this->getSide(0)->getID() === AIR){ //Replace wit 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){
|
public function getBreakTime(Item $item, Player $player){
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue