Remove some direct Position->level accesses

This commit is contained in:
Dylan K. Taylor 2018-12-03 21:39:17 +00:00
parent 9fb365306a
commit 8051fa4f6d
3 changed files with 3 additions and 10 deletions

View File

@ -538,10 +538,7 @@ class BlockFactory{
}
if($pos !== null){
$block->x = $pos->getFloorX();
$block->y = $pos->getFloorY();
$block->z = $pos->getFloorZ();
$block->level = $pos->level;
$block->position($pos->getLevel(), $pos->getFloorX(), $pos->getFloorY(), $pos->getFloorZ());
}
return $block;

View File

@ -51,7 +51,7 @@ class PaintingItem extends Item{
continue;
}
if(Painting::canFit($player->level, $blockReplace, $face, true, $motive)){
if(Painting::canFit($player->getLevel(), $blockReplace, $face, true, $motive)){
if($currentTotalDimension > $totalDimension){
$totalDimension = $currentTotalDimension;
/*

View File

@ -1368,11 +1368,7 @@ class Level implements ChunkManager, Metadatable{
}
$block = BlockFactory::get($id, $meta);
$block->x = $x;
$block->y = $y;
$block->z = $z;
$block->level = $this;
$block->position($this, $x, $y, $z);
static $dynamicStateRead = false;