mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 15:49:54 +00:00
Fixed setSaturation() working incorrectly
This commit is contained in:
parent
27b7260c0a
commit
8e909f05ca
@ -124,6 +124,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
if(isset($reset)){
|
if(isset($reset)){
|
||||||
$this->foodTickTimer = 0;
|
$this->foodTickTimer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMaxFood() : float{
|
public function getMaxFood() : float{
|
||||||
@ -138,7 +139,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getSaturation() : float{
|
public function getSaturation() : float{
|
||||||
return $this->attributeMap->getAttribute(Attribute::HUNGER)->getValue();
|
return $this->attributeMap->getAttribute(Attribute::SATURATION)->getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -150,7 +151,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function setSaturation(float $saturation){
|
public function setSaturation(float $saturation){
|
||||||
$this->attributeMap->getAttribute(Attribute::HUNGER)->setValue($saturation);
|
$this->attributeMap->getAttribute(Attribute::SATURATION)->setValue($saturation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addSaturation(float $amount){
|
public function addSaturation(float $amount){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user