mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-25 04:44:03 +00:00
Entity: Protect internal methods setPosition() and setPositionAndRotation()
teleport() should be used instead (or setRotation() for rotation-only changes).
This commit is contained in:
parent
00944eff72
commit
66481fedeb
@ -1412,7 +1412,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
return $this->asLocation();
|
return $this->asLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPosition(Vector3 $pos) : bool{
|
protected function setPosition(Vector3 $pos) : bool{
|
||||||
if($this->closed){
|
if($this->closed){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1442,7 +1442,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
$this->scheduleUpdate();
|
$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)){
|
if($this->setPosition($pos)){
|
||||||
$this->setRotation($yaw, $pitch);
|
$this->setRotation($yaw, $pitch);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user