mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Updated global Tile code
This commit is contained in:
@ -297,7 +297,7 @@ class Level{
|
||||
$this->server->api->entity->updateRadius($pos, 3);
|
||||
}
|
||||
if($tiles === true){
|
||||
if(($t = $this->server->api->tile->get($pos)) !== false){
|
||||
if(($t = $this->getTile($pos)) !== false){
|
||||
$t->close();
|
||||
}
|
||||
}
|
||||
@ -305,6 +305,21 @@ class Level{
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function getTile(Vector3 $pos){
|
||||
if($pos instanceof Position and $pos->level->getName() !== $this->getName()){
|
||||
return false;
|
||||
}
|
||||
$tiles = $this->getChunkTiles($pos->x >> 4, $pos->z >> 4);
|
||||
if(count($tiles) > 0){
|
||||
foreach($tiles as $tile){
|
||||
if($tile->x === (int) $pos->x and $tile->y === (int) $pos->y and $tile->z === (int) $pos->z){
|
||||
return $tile;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getMiniChunk($X, $Z, $Y){
|
||||
if(!isset($this->level)){
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user