Refactor Block & Tile: getPos() to getPosition() (#4395)

this also changes the name of the class property 'pos' to 'position' as well as Block->getPosOffset() to Block->getPositionOffset()
This commit is contained in:
SalmonDE
2021-08-23 15:01:32 +02:00
committed by GitHub
parent 22316976fa
commit 7fd712c1ff
93 changed files with 402 additions and 402 deletions

View File

@ -228,7 +228,7 @@ class Chunk{
throw new \InvalidArgumentException("Attempted to add a garbage closed Tile to a chunk");
}
$pos = $tile->getPos();
$pos = $tile->getPosition();
if(isset($this->tiles[$index = Chunk::blockHash($pos->x, $pos->y, $pos->z)]) and $this->tiles[$index] !== $tile){
throw new \InvalidArgumentException("Another tile is already at this location");
}
@ -237,7 +237,7 @@ class Chunk{
}
public function removeTile(Tile $tile) : void{
$pos = $tile->getPos();
$pos = $tile->getPosition();
unset($this->tiles[Chunk::blockHash($pos->x, $pos->y, $pos->z)]);
$this->dirtyFlags |= self::DIRTY_FLAG_TILES;
}