Implement new dye types, split bonemeal and cocoa beans into their own classes

This commit is contained in:
Dylan K. Taylor
2019-02-22 11:43:11 +00:00
parent 2bfcd25848
commit 3037f45a0c
9 changed files with 85 additions and 19 deletions

View File

@ -23,20 +23,8 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
class Dye extends Item{
public function __construct(int $variant, string $name){
parent::__construct(self::DYE, $variant, $name);
}
public function getBlock() : Block{
if($this->meta === 3){ //cocoa beans
return BlockFactory::get(Block::COCOA);
}
return parent::getBlock();
}
//TODO: names
}