mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-24 21:49:43 +00:00
fixed ot even more
This commit is contained in:
parent
c3f4def9ea
commit
ca553d6bfd
1 changed files with 47 additions and 44 deletions
|
|
@ -1,6 +1,14 @@
|
|||
<?php
|
||||
|
||||
class BedBlock extends TransparentBlock{
|
||||
|
||||
public static $faces = [
|
||||
0 => 3,
|
||||
1 => 4,
|
||||
2 => 2,
|
||||
3 => 5,
|
||||
];
|
||||
|
||||
public function __construct($type = 0){
|
||||
parent::__construct(BED_BLOCK, $type, "Bed Block");
|
||||
$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){
|
||||
$down = $this->getSide(0);
|
||||
if($down->isTransparent === false){
|
||||
$faces = array(
|
||||
0 => 3,
|
||||
1 => 4,
|
||||
2 => 2,
|
||||
3 => 5,
|
||||
);
|
||||
|
||||
$d = $player->entity->getDirection();
|
||||
$next = $this->getSide($faces[(($d + 3) % 4)]);
|
||||
$next = $this->getSide(self::$faces[(($d + 3) % 4)]);
|
||||
$downNext = $this->getSide(0);
|
||||
if($next->isReplaceable === true and $downNext->isTransparent === false){
|
||||
$meta = (($d + 3) % 4) & 0x03;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue