public function canConnect(Block $block)
 {
     return ($block->getId() !== self::COBBLE_WALL and $block->getId() !== self::FENCE_GATE) ? $block->isSolid() and !$block->isTransparent() : true;
 }
Beispiel #2
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;
 }
Beispiel #3
0
 public function canConnect(Block $block)
 {
     return $block->isSolid() or $block->getId() === $this->getId() or $block->getId() === self::GLASS_PANE or $block->getId() === self::GLASS;
 }
Beispiel #4
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();
 }