From 472431752b17346a4d4f6898591f7e0a9c8321eb Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Tue, 26 Aug 2014 16:19:45 +0200 Subject: [PATCH] Dropped items and arrows get deleted on Y < 0 --- src/pocketmine/entity/Arrow.php | 3 ++- src/pocketmine/entity/DroppedItem.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/entity/Arrow.php b/src/pocketmine/entity/Arrow.php index ccfee599a..8cc76df81 100644 --- a/src/pocketmine/entity/Arrow.php +++ b/src/pocketmine/entity/Arrow.php @@ -91,7 +91,8 @@ class Arrow extends Projectile{ } public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){ - + $this->setLastDamageCause($source); + $this->setHealth($this->getHealth() - $damage); } public function heal($amount){ diff --git a/src/pocketmine/entity/DroppedItem.php b/src/pocketmine/entity/DroppedItem.php index 2e7d8d424..6bbbdedfd 100644 --- a/src/pocketmine/entity/DroppedItem.php +++ b/src/pocketmine/entity/DroppedItem.php @@ -112,7 +112,8 @@ class DroppedItem extends Entity{ } public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){ - + $this->setLastDamageCause($source); + $this->setHealth($this->getHealth() - $damage); } public function heal($amount){