mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Implemented food and hunger
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -15,19 +15,22 @@
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\item;
|
||||
|
||||
|
||||
class CookedFish extends Item{
|
||||
class CookedFish extends Fish{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(self::COOKED_FISH, $meta, $count, "Cooked Fish");
|
||||
if($this->meta === 1){
|
||||
$this->name = "Cooked Salmon";
|
||||
}
|
||||
Food::__construct(self::COOKED_FISH, $meta, $count, $meta === self::FISH_SALMON ? "Cooked Salmon" : "Cooked Fish");
|
||||
}
|
||||
|
||||
public function getFoodRestore() : int{
|
||||
return $this->meta === self::FISH_SALMON ? 6 : 5;
|
||||
}
|
||||
|
||||
public function getSaturationRestore() : int{
|
||||
return $this->meta === self::FISH_SALMON ? 9.6 : 6;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user