Added comments to bed block fix

This commit is contained in:
Michael Yoo 2013-02-19 18:10:55 +10:30
parent 536bfa1f46
commit 66d43228cd

View File

@ -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);