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