Effect: Save and restore ambiency properly

This commit is contained in:
Dylan K. Taylor 2017-12-14 10:10:19 +00:00
parent 4c7038f941
commit 06f605879a

View File

@ -95,7 +95,7 @@ abstract class Living extends Entity implements Damageable{
continue;
}
$effect->setAmplifier($amplifier)->setDuration($e->getInt("Duration"))->setVisible($e->getByte("ShowParticles", 1) > 0);
$effect->setAmplifier($amplifier)->setDuration($e->getInt("Duration"))->setVisible($e->getByte("ShowParticles", 1) > 0)->setAmbient($e->getByte("Ambient", 0) !== 0);
$this->addEffect($effect);
}
@ -147,7 +147,7 @@ abstract class Living extends Entity implements Damageable{
new ByteTag("Id", $effect->getId()),
new ByteTag("Amplifier", Binary::signByte($effect->getAmplifier())),
new IntTag("Duration", $effect->getDuration()),
new ByteTag("Ambient", 0),
new ByteTag("Ambient", $effect->isAmbient() ? 1 : 0),
new ByteTag("ShowParticles", $effect->isVisible() ? 1 : 0)
]);
}