diff --git a/src/pocketmine/block/Torch.php b/src/pocketmine/block/Torch.php index 218e242aa..bdca61ac9 100644 --- a/src/pocketmine/block/Torch.php +++ b/src/pocketmine/block/Torch.php @@ -44,6 +44,7 @@ class Torch extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ + $below = $this->getSide(0); $side = $this->getDamage(); $faces = [ 1 => 4, @@ -55,7 +56,7 @@ class Torch extends Flowable{ 0 => 0, ]; - if($this->getSide($faces[$side])->isTransparent() === true and !($side === 0 and $this->getSide(0)->getId() === self::FENCE)){ + if($this->getSide($faces[$side])->isTransparent() === true and !($side === 0 and ($below->getId() === self::FENCE or $below->getId() === self::COBBLE_WALL))){ $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; @@ -66,6 +67,8 @@ class Torch extends Flowable{ } 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, @@ -78,7 +81,7 @@ class Torch extends Flowable{ $this->getLevel()->setBlock($block, $this, true, true); return true; - }elseif($this->getSide(0)->isTransparent() === false or $this->getSide(0)->getId() === self::FENCE){ + }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);