From 00944eff721eb11b67cf514680eb59182c008d7a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 7 May 2019 17:37:10 +0100 Subject: [PATCH] Removed EntityWorldChangeEvent there's nothing that can be done with this event that can't be done with EntityTeleportEvent. Having this extra event needlessly increases system complexity. --- src/pocketmine/entity/Entity.php | 7 --- .../event/entity/EntityWorldChangeEvent.php | 52 ------------------- 2 files changed, 59 deletions(-) delete mode 100644 src/pocketmine/event/entity/EntityWorldChangeEvent.php diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 71c8f5e70..6c16ac7a9 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -34,7 +34,6 @@ use pocketmine\event\entity\EntityMotionEvent; use pocketmine\event\entity\EntityRegainHealthEvent; use pocketmine\event\entity\EntitySpawnEvent; use pocketmine\event\entity\EntityTeleportEvent; -use pocketmine\event\entity\EntityWorldChangeEvent; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Bearing; use pocketmine\math\Facing; @@ -1569,12 +1568,6 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ } if($this->isValid()){ - $ev = new EntityWorldChangeEvent($this, $this->world, $targetWorld); - $ev->call(); - if($ev->isCancelled()){ - return false; - } - $this->world->removeEntity($this); if($this->chunk !== null){ $this->chunk->removeEntity($this); diff --git a/src/pocketmine/event/entity/EntityWorldChangeEvent.php b/src/pocketmine/event/entity/EntityWorldChangeEvent.php deleted file mode 100644 index fc020a7a4..000000000 --- a/src/pocketmine/event/entity/EntityWorldChangeEvent.php +++ /dev/null @@ -1,52 +0,0 @@ -entity = $entity; - $this->originWorld = $originWorld; - $this->targetWorld = $targetWorld; - } - - public function getOrigin() : World{ - return $this->originWorld; - } - - public function getTarget() : World{ - return $this->targetWorld; - } -}