diff --git a/src/pocketmine/block/DoublePlant.php b/src/pocketmine/block/DoublePlant.php index 5e2ebc81f..a60cc2201 100644 --- a/src/pocketmine/block/DoublePlant.php +++ b/src/pocketmine/block/DoublePlant.php @@ -52,7 +52,7 @@ class DoublePlant extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->isTransparent() === true){ //Replace with common break method - $this->getLevel()->setBlock($this, new Air(), false, false, true); + $this->getLevel()->setBlock($this, new Air(), true, true); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/block/Fallable.php b/src/pocketmine/block/Fallable.php index 2881e084a..87ecc4619 100644 --- a/src/pocketmine/block/Fallable.php +++ b/src/pocketmine/block/Fallable.php @@ -22,7 +22,6 @@ namespace pocketmine\block; use pocketmine\entity\Entity; -use pocketmine\item\Item; use pocketmine\level\Level; use pocketmine\math\Vector3; use pocketmine\nbt\tag\ByteTag; @@ -31,7 +30,6 @@ use pocketmine\nbt\tag\DoubleTag; use pocketmine\nbt\tag\FloatTag; use pocketmine\nbt\tag\IntTag; use pocketmine\nbt\tag\ListTag; -use pocketmine\Player; abstract class Fallable extends Solid{ diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index 508c37868..07b970d7c 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -124,11 +124,16 @@ class Ladder extends Transparent{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - /*if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method - Server::getInstance()->api->entity->drop($this, Item::get(LADDER, 0, 1)); - $this->getLevel()->setBlock($this, new Air(), true, true, true); + $sides = [ + 2 => 3, + 3 => 2, + 4 => 5, + 5 => 4 + ]; + if(!$this->getSide($sides[$this->meta])->isSolid()){ //Replace with common break method + $this->level->setBlock($this, new Air(), true, true); return Level::BLOCK_UPDATE_NORMAL; - }*/ + } } return false; diff --git a/src/pocketmine/block/Leaves.php b/src/pocketmine/block/Leaves.php index 855f41641..67e9d9e62 100644 --- a/src/pocketmine/block/Leaves.php +++ b/src/pocketmine/block/Leaves.php @@ -129,7 +129,7 @@ class Leaves extends Transparent{ if($type === Level::BLOCK_UPDATE_NORMAL){ if(($this->meta & 0b00001100) === 0){ $this->meta |= 0x08; - $this->getLevel()->setBlock($this, $this, false, false, true); + $this->getLevel()->setBlock($this, $this, true, false); } }elseif($type === Level::BLOCK_UPDATE_RANDOM){ if(($this->meta & 0b00001100) === 0x08){ diff --git a/src/pocketmine/block/Leaves2.php b/src/pocketmine/block/Leaves2.php index 7869c4935..964219ac0 100644 --- a/src/pocketmine/block/Leaves2.php +++ b/src/pocketmine/block/Leaves2.php @@ -112,7 +112,7 @@ class Leaves2 extends Leaves{ if($type === Level::BLOCK_UPDATE_NORMAL){ if(($this->meta & 0b00001100) === 0){ $this->meta |= 0x08; - $this->getLevel()->setBlock($this, $this, false, false, true); + $this->getLevel()->setBlock($this, $this, true, false); } }elseif($type === Level::BLOCK_UPDATE_RANDOM){ if(($this->meta & 0b00001100) === 0x08){ diff --git a/src/pocketmine/block/TallGrass.php b/src/pocketmine/block/TallGrass.php index 9214a3442..ce485770d 100644 --- a/src/pocketmine/block/TallGrass.php +++ b/src/pocketmine/block/TallGrass.php @@ -62,7 +62,7 @@ class TallGrass extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->isTransparent() === true){ //Replace with common break method - $this->getLevel()->setBlock($this, new Air(), false, false, true); + $this->getLevel()->setBlock($this, new Air(), true, true); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/block/Vine.php b/src/pocketmine/block/Vine.php index 14def3f33..60a88c198 100644 --- a/src/pocketmine/block/Vine.php +++ b/src/pocketmine/block/Vine.php @@ -146,7 +146,7 @@ class Vine extends Transparent{ if($type === Level::BLOCK_UPDATE_NORMAL){ /*if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method Server::getInstance()->api->entity->drop($this, Item::get(LADDER, 0, 1)); - $this->getLevel()->setBlock($this, new Air(), true, true, true); + $this->getLevel()->setBlock($this, new Air(), true, true); return Level::BLOCK_UPDATE_NORMAL; }*/ }