mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
parent
9134a69936
commit
547e152e40
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user