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

@ -45,7 +45,7 @@ class Chest extends Transparent{
}
public function onPostPlace() : void{
$tile = $this->pos->getWorld()->getTile($this->pos);
$tile = $this->position->getWorld()->getTile($this->position);
if($tile instanceof TileChest){
foreach([
Facing::rotateY($this->facing, true),
@ -53,7 +53,7 @@ class Chest extends Transparent{
] as $side){
$c = $this->getSide($side);
if($c instanceof Chest and $c->isSameType($this) and $c->facing === $this->facing){
$pair = $this->pos->getWorld()->getTile($c->pos);
$pair = $this->position->getWorld()->getTile($c->position);
if($pair instanceof TileChest and !$pair->isPaired()){
$pair->pairWith($tile);
$tile->pairWith($pair);
@ -67,7 +67,7 @@ class Chest extends Transparent{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($player instanceof Player){
$chest = $this->pos->getWorld()->getTile($this->pos);
$chest = $this->position->getWorld()->getTile($this->position);
if($chest instanceof TileChest){
if(
!$this->getSide(Facing::UP)->isTransparent() or