mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 08:19:45 +00:00
Merge commit '8c5a81cf5'
# Conflicts: # resources/vanilla
This commit is contained in:
commit
2bf73c7a4a
@ -467,12 +467,14 @@ abstract class Living extends Entity{
|
|||||||
|
|
||||||
$this->attackTime = $source->getAttackCooldown();
|
$this->attackTime = $source->getAttackCooldown();
|
||||||
|
|
||||||
if($source instanceof EntityDamageByEntityEvent){
|
if($source instanceof EntityDamageByChildEntityEvent){
|
||||||
$e = $source->getDamager();
|
$e = $source->getChild();
|
||||||
if($source instanceof EntityDamageByChildEntityEvent){
|
if($e !== null){
|
||||||
$e = $source->getChild();
|
$motion = $e->getMotion();
|
||||||
|
$this->knockBack($motion->x, $motion->z, $source->getKnockBack());
|
||||||
}
|
}
|
||||||
|
}elseif($source instanceof EntityDamageByEntityEvent){
|
||||||
|
$e = $source->getDamager();
|
||||||
if($e !== null){
|
if($e !== null){
|
||||||
$deltaX = $this->location->x - $e->location->x;
|
$deltaX = $this->location->x - $e->location->x;
|
||||||
$deltaZ = $this->location->z - $e->location->z;
|
$deltaZ = $this->location->z - $e->location->z;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user