From dd1dfefd836115b74b3ac80ed7388f8c759fc25d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 4 May 2018 22:57:28 +0100 Subject: [PATCH] ItemEntity: remove unnecessary damage types restrictions Invalid damage types are all restricted by other means anyway. This fixes items not getting killed by fire (close #2143) and cacti. --- src/pocketmine/entity/object/ItemEntity.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/pocketmine/entity/object/ItemEntity.php b/src/pocketmine/entity/object/ItemEntity.php index fc9842494..7f6a5d5bb 100644 --- a/src/pocketmine/entity/object/ItemEntity.php +++ b/src/pocketmine/entity/object/ItemEntity.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace pocketmine\entity\object; use pocketmine\entity\Entity; -use pocketmine\event\entity\EntityDamageEvent; use pocketmine\event\entity\ItemDespawnEvent; use pocketmine\event\entity\ItemSpawnEvent; use pocketmine\event\inventory\InventoryPickupItemEvent; @@ -77,18 +76,6 @@ class ItemEntity extends Entity{ $this->server->getPluginManager()->callEvent(new ItemSpawnEvent($this)); } - public function attack(EntityDamageEvent $source){ - if( - $source->getCause() === EntityDamageEvent::CAUSE_VOID or - $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK or - $source->getCause() === EntityDamageEvent::CAUSE_LAVA or - $source->getCause() === EntityDamageEvent::CAUSE_ENTITY_EXPLOSION or - $source->getCause() === EntityDamageEvent::CAUSE_BLOCK_EXPLOSION - ){ - parent::attack($source); - } - } - public function entityBaseTick(int $tickDiff = 1) : bool{ if($this->closed){ return false;