This commit is contained in:
PeratX 2016-04-08 07:15:43 +08:00
commit a1ec60a194
2 changed files with 13 additions and 0 deletions

View file

@ -26,6 +26,7 @@ use pocketmine\item\Item;
use pocketmine\item\Tool;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
@ -56,6 +57,17 @@ class GrassPath extends Transparent{
);
}
public function onUpdate($type){
if($type == Level::BLOCK_UPDATE_NORMAL){
$block = $this->getSide(self::SIDE_UP);
if($block->getId() != self::AIR){
$this->getLevel()->setBlock($this, new Dirt(), true);
}
return Level::BLOCK_UPDATE_NORMAL;
}
return false;
}
public function getHardness() {
return 0.6;
}

View file

@ -94,6 +94,7 @@ class TNT extends Solid implements ElectricalAppliance{
$block = $this->getSide($side);
if($block instanceof RedstoneSource and $block->isActivated($this)){
$this->prime();
$this->getLevel()->setBlock($this, new Air(), true);
break;
}
}