Fix some non-properly-implemented blocks killing people and bad inheritances

This commit is contained in:
Dylan K. Taylor
2017-02-21 11:17:33 +00:00
parent 408f63f8fa
commit f933107af0
19 changed files with 29 additions and 42 deletions

View File

@ -25,7 +25,7 @@ use pocketmine\item\Item;
use pocketmine\item\Tool;
use pocketmine\Player;
class LitPumpkin extends Solid{
class LitPumpkin extends Pumpkin{
protected $id = self::LIT_PUMPKIN;
@ -33,28 +33,7 @@ class LitPumpkin extends Solid{
return 15;
}
public function getHardness(){
return 1;
}
public function getToolType(){
return Tool::TYPE_AXE;
}
public function getName(){
return "Jack o'Lantern";
}
public function __construct($meta = 0){
$this->meta = $meta;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
if($player instanceof Player){
$this->meta = ((int) $player->getDirection() + 5) % 4;
}
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
}