mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
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:
parent
7565b786e7
commit
dd1dfefd83
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user