fixed ot even more

This commit is contained in:
GameHerobrine 2023-08-21 03:15:13 +03:00
parent c3f4def9ea
commit ca553d6bfd

View file

@ -1,6 +1,14 @@
<?php <?php
class BedBlock extends TransparentBlock{ class BedBlock extends TransparentBlock{
public static $faces = [
0 => 3,
1 => 4,
2 => 2,
3 => 5,
];
public function __construct($type = 0){ public function __construct($type = 0){
parent::__construct(BED_BLOCK, $type, "Bed Block"); parent::__construct(BED_BLOCK, $type, "Bed Block");
$this->isActivable = true; $this->isActivable = true;
@ -50,14 +58,9 @@ class BedBlock extends TransparentBlock{
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0); $down = $this->getSide(0);
if($down->isTransparent === false){ if($down->isTransparent === false){
$faces = array(
0 => 3,
1 => 4,
2 => 2,
3 => 5,
);
$d = $player->entity->getDirection(); $d = $player->entity->getDirection();
$next = $this->getSide($faces[(($d + 3) % 4)]); $next = $this->getSide(self::$faces[(($d + 3) % 4)]);
$downNext = $this->getSide(0); $downNext = $this->getSide(0);
if($next->isReplaceable === true and $downNext->isTransparent === false){ if($next->isReplaceable === true and $downNext->isTransparent === false){
$meta = (($d + 3) % 4) & 0x03; $meta = (($d + 3) % 4) & 0x03;