fixed BedBlock formatting

This commit is contained in:
GameHerobrine 2023-08-21 03:13:50 +03:00
parent 14923444f2
commit c3f4def9ea

View file

@ -16,28 +16,28 @@ class BedBlock extends TransparentBlock{
return true; return true;
} }
$blockNorth = $this->getSide(2); //Gets the blocks around them $blockNorth = $this->getSide(2); //Gets the blocks around them
$blockSouth = $this->getSide(3); $blockSouth = $this->getSide(3);
$blockEast = $this->getSide(5); $blockEast = $this->getSide(5);
$blockWest = $this->getSide(4); $blockWest = $this->getSide(4);
if(($this->meta & 0x08) === 0x08){ //This is the Top part of bed if(($this->meta & 0x08) === 0x08){ //This is the Top part of bed
$b = $this; $b = $this;
}else{ //Bottom Part of Bed }else{ //Bottom Part of Bed
if($blockNorth->getID() === $this->id and ($blockNorth->meta & 0x08) === 0x08){ if($blockNorth->getID() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
$b = $blockNorth; $b = $blockNorth;
}elseif($blockSouth->getID() === $this->id and ($blockSouth->meta & 0x08) === 0x08){ }elseif($blockSouth->getID() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
$b = $blockSouth; $b = $blockSouth;
}elseif($blockEast->getID() === $this->id and ($blockEast->meta & 0x08) === 0x08){ }elseif($blockEast->getID() === $this->id and ($blockEast->meta & 0x08) === 0x08){
$b = $blockEast; $b = $blockEast;
}elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){ }elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){
$b = $blockWest; $b = $blockWest;
}else{ }else{
$pk = new ChatPacket; $pk = new ChatPacket;
$pk->message = "This bed is incomplete"; $pk->message = "This bed is incomplete";
$player->dataPacket($pk); $player->dataPacket($pk);
return true; return true;
}
} }
}
if($player->sleepOn($b) === false){ if($player->sleepOn($b) === false){
$pk = new ChatPacket; $pk = new ChatPacket;