Fixed #2615, closes #2634 invalid pull request

This commit is contained in:
Shoghi Cervantes 2015-02-15 15:10:36 +01:00
parent 9134a69936
commit 547e152e40
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89

View File

@ -44,6 +44,7 @@ class Torch extends Flowable{
public function onUpdate($type){ public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){ if($type === Level::BLOCK_UPDATE_NORMAL){
$below = $this->getSide(0);
$side = $this->getDamage(); $side = $this->getDamage();
$faces = [ $faces = [
1 => 4, 1 => 4,
@ -55,7 +56,7 @@ class Torch extends Flowable{
0 => 0, 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); $this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL; 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){ 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){ if($target->isTransparent() === false and $face !== 0){
$faces = [ $faces = [
1 => 5, 1 => 5,
@ -78,7 +81,7 @@ class Torch extends Flowable{
$this->getLevel()->setBlock($block, $this, true, true); $this->getLevel()->setBlock($block, $this, true, true);
return 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->meta = 0;
$this->getLevel()->setBlock($block, $this, true, true); $this->getLevel()->setBlock($block, $this, true, true);