mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user