Merge branch 'master' into api3/network_mcpe-1.0.5

This commit is contained in:
Dylan K. Taylor
2017-03-21 10:47:41 +00:00
9 changed files with 21 additions and 20 deletions

View File

@ -470,7 +470,7 @@ abstract class Entity extends Location implements Metadatable{
if(isset($this->effects[$effect->getId()])){
$oldEffect = $this->effects[$effect->getId()];
if(
abs($effect->getAmplifier()) <= ($oldEffect->getAmplifier())
abs($effect->getAmplifier()) < ($oldEffect->getAmplifier())
or (abs($effect->getAmplifier()) === abs($oldEffect->getAmplifier())
and $effect->getDuration() < $oldEffect->getDuration())
){

View File

@ -408,6 +408,12 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
public function saveNBT(){
parent::saveNBT();
$this->namedtag->foodLevel = new IntTag("foodLevel", $this->getFood());
$this->namedtag->foodExhaustionLevel = new FloatTag("foodExhaustionLevel", $this->getExhaustion());
$this->namedtag->foodSaturationLevel = new FloatTag("foodSaturationLevel", $this->getSaturation());
$this->namedtag->foodTickTimer = new IntTag("foodTickTimer", $this->foodTickTimer);
$this->namedtag->Inventory = new ListTag("Inventory", []);
$this->namedtag->Inventory->setTagType(NBT::TAG_Compound);
if($this->inventory !== null){