diff --git a/src/pocketmine/block/Cobweb.php b/src/pocketmine/block/Cobweb.php index 5e8a54067..6d23ee273 100644 --- a/src/pocketmine/block/Cobweb.php +++ b/src/pocketmine/block/Cobweb.php @@ -22,6 +22,7 @@ namespace pocketmine\block; use pocketmine\item\Item; +use pocketmine\entity\Entity; class Cobweb extends Flowable{ public function __construct(){ @@ -31,6 +32,10 @@ class Cobweb extends Flowable{ $this->hardness = 25; } + public function onEntityCollide(Entity $entity){ + $entity->fallDistance = 0; + } + public function getDrops(Item $item){ return []; } diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index c01fff0c3..46741daee 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -25,6 +25,7 @@ use pocketmine\item\Item; use pocketmine\level\Level; use pocketmine\math\AxisAlignedBB; use pocketmine\Player; +use pocketmine\entity\Entity; class Ladder extends Transparent{ public function __construct($meta = 0){ @@ -34,6 +35,10 @@ class Ladder extends Transparent{ $this->hardness = 2; } + public function onEntityCollide(Entity $entity){ + $entity->fallDistance = 0; + } + public function getBoundingBox(){ $f = 0.125; diff --git a/src/pocketmine/block/StillWater.php b/src/pocketmine/block/StillWater.php index 1ef791042..47b924303 100644 --- a/src/pocketmine/block/StillWater.php +++ b/src/pocketmine/block/StillWater.php @@ -21,6 +21,7 @@ namespace pocketmine\block; +use pocketmine\entity\Entity; class StillWater extends Water{ public function __construct($meta = 0){ @@ -28,4 +29,9 @@ class StillWater extends Water{ $this->hardness = 500; } + public function onEntityCollide(Entity $entity){ + $entity->fallDistance = 0; + $entity->extinguish(); + } + } \ No newline at end of file diff --git a/src/pocketmine/block/Water.php b/src/pocketmine/block/Water.php index f1287eeab..c7174c5c6 100644 --- a/src/pocketmine/block/Water.php +++ b/src/pocketmine/block/Water.php @@ -26,6 +26,7 @@ use pocketmine\level\Level; use pocketmine\level\Position; use pocketmine\Player; use pocketmine\Server; +use pocketmine\entity\Entity; class Water extends Liquid{ public function __construct($meta = 0){ @@ -36,7 +37,11 @@ class Water extends Liquid{ public function getBoundingBox(){ return null; } - + + public function onEntityCollide(Entity $entity){ + $entity->fallDistance = 0; + $entity->extinguish(); + } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $ret = $this->getLevel()->setBlock($this, $this, true);