mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Added comments to bed block fix
This commit is contained in:
parent
536bfa1f46
commit
66d43228cd
@ -56,15 +56,15 @@ class BedBlock extends TransparentBlock{
|
||||
}
|
||||
|
||||
public function onBreak(BlockAPI $level, Item $item, Player $player){
|
||||
if($this->inWorld === true){
|
||||
$blockNorth = $level->getBlockFace($this, 2);
|
||||
if($this->inWorld === true){//Checks if the block was in the world or not. Just in case
|
||||
$blockNorth = $level->getBlockFace($this, 2);//Gets the blocks around them
|
||||
$blockSouth = $level->getBlockFace($this, 3);
|
||||
$blockEast = $level->getBlockFace($this, 5);
|
||||
$blockWest = $level->getBlockFace($this, 4);
|
||||
|
||||
if(($this->meta & 0x08) === 0x08){//This is the Top part of bed
|
||||
|
||||
if($blockNorth->getID() === $this->id and $blockNorth->meta != 0x08)
|
||||
if($blockNorth->getID() === $this->id and $blockNorth->meta != 0x08)//Checks if the block ID and meta are right
|
||||
$level->setBlock($blockNorth, 0, 0);
|
||||
if($blockSouth->getID() === $this->id and $blockSouth->meta != 0x08)
|
||||
$level->setBlock($blockSouth, 0, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user