mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Implement new dye types, split bonemeal and cocoa beans into their own classes
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user