diff --git a/src/pocketmine/block/Bed.php b/src/pocketmine/block/Bed.php index c1b59ade4..a6901e9df 100644 --- a/src/pocketmine/block/Bed.php +++ b/src/pocketmine/block/Bed.php @@ -27,6 +27,7 @@ use pocketmine\event\TranslationContainer; use pocketmine\item\Item; use pocketmine\level\Level; use pocketmine\math\AxisAlignedBB; +use pocketmine\math\Vector3; use pocketmine\nbt\tag\ByteTag; use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\IntTag; @@ -106,7 +107,7 @@ class Bed extends Transparent{ } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ - $down = $this->getSide(0); + $down = $this->getSide(Vector3::SIDE_DOWN); if($down->isTransparent() === false){ $faces = [ 0 => 3, @@ -116,7 +117,7 @@ class Bed extends Transparent{ ]; $d = $player instanceof Player ? $player->getDirection() : 0; $next = $this->getSide($faces[($d + 3) % 4]); - $downNext = $this->getSide(0); + $downNext = $next->getSide(Vector3::SIDE_DOWN); if($next->canBeReplaced() === true and $downNext->isTransparent() === false){ $meta = (($d + 3) % 4) & 0x03; $this->getLevel()->setBlock($block, Block::get($this->id, $meta), true, true);