From 66481fedebf6108ce95aa6e80039799e2c9292e2 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 7 May 2019 17:38:33 +0100 Subject: [PATCH] Entity: Protect internal methods setPosition() and setPositionAndRotation() teleport() should be used instead (or setRotation() for rotation-only changes). --- src/pocketmine/entity/Entity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 6c16ac7a95..a17b9f0914 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1412,7 +1412,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ return $this->asLocation(); } - public function setPosition(Vector3 $pos) : bool{ + protected function setPosition(Vector3 $pos) : bool{ if($this->closed){ return false; } @@ -1442,7 +1442,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ $this->scheduleUpdate(); } - public function setPositionAndRotation(Vector3 $pos, float $yaw, float $pitch) : bool{ + protected function setPositionAndRotation(Vector3 $pos, float $yaw, float $pitch) : bool{ if($this->setPosition($pos)){ $this->setRotation($yaw, $pitch);