mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Implemented food and hunger
This commit is contained in:
@ -23,9 +23,17 @@ namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
|
||||
class Carrot extends Item{
|
||||
class Carrot extends Food{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
$this->block = Block::get(Item::CARROT_BLOCK);
|
||||
parent::__construct(self::CARROT, 0, $count, "Carrot");
|
||||
}
|
||||
}
|
||||
|
||||
public function getFoodRestore() : int{
|
||||
return 3;
|
||||
}
|
||||
|
||||
public function getSaturationRestore() : float{
|
||||
return 4.8;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user