예제 #1
0
 public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
 {
     if ($target->isTransparent() === false) {
         $faces = [2 => 2, 3 => 3, 4 => 4, 5 => 5];
         if (isset($faces[$face])) {
             $this->meta = $faces[$face];
             $this->getLevel()->setBlock($block, $this, true, true);
             return true;
         }
     }
     return false;
 }
예제 #2
0
 public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
 {
     if (($target->isTransparent() === false or $target->getId() === self::SLAB) and $face !== 0 and $face !== 1) {
         $faces = [2 => 0, 3 => 1, 4 => 2, 5 => 3];
         $this->meta = $faces[$face] & 0x3;
         if ($fy > 0.5) {
             $this->meta |= 0x8;
         }
         $this->getLevel()->setBlock($block, $this, true, true);
         return true;
     }
     return false;
 }
예제 #3
0
 public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
 {
     $below = $this->getSide(0);
     if ($target->isTransparent() === false and $face !== 0) {
         $faces = [1 => 5, 2 => 4, 3 => 3, 4 => 2, 5 => 1];
         $this->meta = $faces[$face];
         $this->getLevel()->setBlock($block, $this, true, true);
         return true;
     } elseif ($below->isTransparent() === false or $below->getId() === self::FENCE or $below->getId() === self::COBBLE_WALL) {
         $this->meta = 0;
         $this->getLevel()->setBlock($block, $this, true, true);
         return true;
     }
     return false;
 }
예제 #4
0
 public function canConnect(Block $block)
 {
     return ($block->getId() !== self::COBBLE_WALL and $block->getId() !== self::FENCE_GATE) ? $block->isSolid() and !$block->isTransparent() : true;
 }
예제 #5
0
 public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
 {
     if (!$target->isTransparent() and $target->isSolid()) {
         $faces = [0 => 0, 1 => 0, 2 => 1, 3 => 4, 4 => 8, 5 => 2];
         if (isset($faces[$face])) {
             $this->meta = $faces[$face];
             $this->getLevel()->setBlock($block, $this, true, true);
             return true;
         }
     }
     return false;
 }
예제 #6
0
 public function canConnect(Block $block)
 {
     return ($block instanceof Fence or $block instanceof FenceGate) ? true : $block->isSolid() and !$block->isTransparent();
 }
 public function canConnect(Block $block)
 {
     //TODO: activate comments when the NetherBrickFenceGate class has been created.
     return $block instanceof NetherBrickFence ? true : $block->isSolid() and !$block->isTransparent();
 }