mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 15:49:54 +00:00
Merge pull request #2577 from Falkirks/master
Improve FallingSand behaviour
This commit is contained in:
commit
8421985102
@ -23,6 +23,8 @@ namespace pocketmine\entity;
|
|||||||
|
|
||||||
|
|
||||||
use pocketmine\block\Block;
|
use pocketmine\block\Block;
|
||||||
|
use pocketmine\block\Flowable;
|
||||||
|
use pocketmine\block\Liquid;
|
||||||
use pocketmine\event\entity\EntityBlockChangeEvent;
|
use pocketmine\event\entity\EntityBlockChangeEvent;
|
||||||
use pocketmine\event\entity\EntityDamageEvent;
|
use pocketmine\event\entity\EntityDamageEvent;
|
||||||
use pocketmine\event\entity\EntityRegainHealthEvent;
|
use pocketmine\event\entity\EntityRegainHealthEvent;
|
||||||
@ -111,7 +113,7 @@ class FallingSand extends Entity{
|
|||||||
if($this->onGround){
|
if($this->onGround){
|
||||||
$this->kill();
|
$this->kill();
|
||||||
$block = $this->level->getBlock($pos);
|
$block = $this->level->getBlock($pos);
|
||||||
if($block->getId() > 0 and !$block->isSolid()){
|
if($block->getId() > 0 and !$block->isSolid() and !($block instanceof Liquid)){
|
||||||
$this->getLevel()->dropItem($this, ItemItem::get($this->getBlock(), $this->getDamage(), 1));
|
$this->getLevel()->dropItem($this, ItemItem::get($this->getBlock(), $this->getDamage(), 1));
|
||||||
}else{
|
}else{
|
||||||
$this->server->getPluginManager()->callEvent($ev = new EntityBlockChangeEvent($this, $block, Block::get($this->getBlock(), $this->getDamage())));
|
$this->server->getPluginManager()->callEvent($ev = new EntityBlockChangeEvent($this, $block, Block::get($this->getBlock(), $this->getDamage())));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user