mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-10 20:08:01 +00:00
Living: Get rid of delayed XP spawning, closes #2644
This is not identical to vanilla, but I don't care because it gets rid of edge cases and also makes it easier to integrate with EntityDeathEvent in the future.
This commit is contained in:
parent
5a8812b1dc
commit
e6d1c1dfbc
@ -644,6 +644,10 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
foreach($ev->getDrops() as $item){
|
foreach($ev->getDrops() as $item){
|
||||||
$this->getLevel()->dropItem($this, $item);
|
$this->getLevel()->dropItem($this, $item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: check death conditions (must have been damaged by player < 5 seconds from death)
|
||||||
|
//TODO: allow this number to be manipulated during EntityDeathEvent
|
||||||
|
$this->level->dropExperience($this, $this->getXpDropAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function onDeathUpdate(int $tickDiff) : bool{
|
protected function onDeathUpdate(int $tickDiff) : bool{
|
||||||
@ -651,9 +655,6 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
$this->deadTicks += $tickDiff;
|
$this->deadTicks += $tickDiff;
|
||||||
if($this->deadTicks >= $this->maxDeadTicks){
|
if($this->deadTicks >= $this->maxDeadTicks){
|
||||||
$this->endDeathAnimation();
|
$this->endDeathAnimation();
|
||||||
|
|
||||||
//TODO: check death conditions (must have been damaged by player < 5 seconds from death)
|
|
||||||
$this->level->dropExperience($this, $this->getXpDropAmount());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user