mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-26 05:14:05 +00:00
Eradicate remaining usages of Position->getWorld()
This commit is contained in:
parent
43ae1a5cb4
commit
fc22fd80d8
@ -79,7 +79,7 @@ class Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __clone(){
|
public function __clone(){
|
||||||
$this->pos = Position::fromObject($this->pos, $this->pos->getWorld());
|
$this->pos = Position::fromObject($this->pos, $this->pos->getWorldNonNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIdInfo() : BlockIdentifier{
|
public function getIdInfo() : BlockIdentifier{
|
||||||
|
@ -713,7 +713,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function switchWorld(World $targetWorld) : bool{
|
protected function switchWorld(World $targetWorld) : bool{
|
||||||
$oldWorld = $this->location->getWorld();
|
$oldWorld = $this->location->isValid() ? $this->location->getWorldNonNull() : null;
|
||||||
if(parent::switchWorld($targetWorld)){
|
if(parent::switchWorld($targetWorld)){
|
||||||
if($oldWorld !== null){
|
if($oldWorld !== null){
|
||||||
foreach($this->usedChunks as $index => $status){
|
foreach($this->usedChunks as $index => $status){
|
||||||
|
@ -119,7 +119,7 @@ class Position extends Vector3{
|
|||||||
|
|
||||||
public function equals(Vector3 $v) : bool{
|
public function equals(Vector3 $v) : bool{
|
||||||
if($v instanceof Position){
|
if($v instanceof Position){
|
||||||
return parent::equals($v) and $v->getWorld() === $this->getWorld();
|
return parent::equals($v) and $v->world === $this->world;
|
||||||
}
|
}
|
||||||
return parent::equals($v);
|
return parent::equals($v);
|
||||||
}
|
}
|
||||||
|
@ -2043,7 +2043,7 @@ class World implements ChunkManager{
|
|||||||
throw new \InvalidArgumentException("Attempted to add a garbage closed Tile to world");
|
throw new \InvalidArgumentException("Attempted to add a garbage closed Tile to world");
|
||||||
}
|
}
|
||||||
$pos = $tile->getPos();
|
$pos = $tile->getPos();
|
||||||
if($pos->getWorld() !== $this){
|
if(!$pos->isValid() || $pos->getWorldNonNull() !== $this){
|
||||||
throw new \InvalidArgumentException("Invalid Tile world");
|
throw new \InvalidArgumentException("Invalid Tile world");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2065,7 +2065,7 @@ class World implements ChunkManager{
|
|||||||
*/
|
*/
|
||||||
public function removeTile(Tile $tile) : void{
|
public function removeTile(Tile $tile) : void{
|
||||||
$pos = $tile->getPos();
|
$pos = $tile->getPos();
|
||||||
if($pos->getWorld() !== $this){
|
if(!$pos->isValid() || $pos->getWorldNonNull() !== $this){
|
||||||
throw new \InvalidArgumentException("Invalid Tile world");
|
throw new \InvalidArgumentException("Invalid Tile world");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user