Merge branch 'next-minor'

# Conflicts:
#	changelogs/3.12.md
#	resources/vanilla
#	src/VersionInfo.php
This commit is contained in:
Dylan K. Taylor
2020-06-03 13:11:30 +01:00
5 changed files with 148 additions and 64 deletions

View File

@ -356,6 +356,9 @@ abstract class Living extends Entity{
*/
public function applyDamageModifiers(EntityDamageEvent $source) : void{
if($this->lastDamageCause !== null and $this->attackTime > 0){
if($this->lastDamageCause->getBaseDamage() >= $source->getBaseDamage()){
$source->setCancelled();
}
$source->setModifier(-$this->lastDamageCause->getBaseDamage(), EntityDamageEvent::MODIFIER_PREVIOUS_DAMAGE_COOLDOWN);
}
if($source->canBeReducedByArmor()){