mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
Improved Level::getBlock()
This commit is contained in:
parent
01ebe74974
commit
4edadd764c
@ -728,10 +728,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$entity->despawnFrom($this);
|
$entity->despawnFrom($this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*$pk = new UnloadChunkPacket();
|
|
||||||
$pk->chunkX = $X;
|
|
||||||
$pk->chunkZ = $Z;
|
|
||||||
$this->dataPacket($pk);*/
|
|
||||||
unset($this->usedChunks[$index]);
|
unset($this->usedChunks[$index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -698,7 +698,16 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->getChunkAt($pos->x >> 4, $pos->z >> 4, true)->getBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f, $blockId, $meta);
|
$this->getChunkAt($pos->x >> 4, $pos->z >> 4, true)->getBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f, $blockId, $meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Block::get($blockId, $meta, Position::fromObject(clone $pos, $this));
|
if($blockId === 0){
|
||||||
|
$air = new Air();
|
||||||
|
$air->x = $pos->x;
|
||||||
|
$air->y = $pos->y;
|
||||||
|
$air->z = $pos->z;
|
||||||
|
$air->level = $this;
|
||||||
|
return $air;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Block::get($blockId, $meta, Position::fromObject($pos, $this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user