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.
This commit is contained in:
Dylan K. Taylor 2018-05-04 22:57:28 +01:00
parent 7565b786e7
commit dd1dfefd83

View File

@ -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;