MAp getFloor() method

This commit is contained in:
Shoghi Cervantes Pueyo
2012-12-21 20:57:40 +01:00
parent 3e54ceb8a3
commit 67d5e92def
2 changed files with 24 additions and 1 deletions

View File

@ -68,7 +68,9 @@ class LevelAPI{
}
private function check(){
if($this->active === false and $this->server->map === false){
if($this->active === true){
return true;
}elseif($this->active === false and $this->server->map === false){
return false;
}
$this->active = true;
@ -89,6 +91,13 @@ class LevelAPI{
return array(0,0);
}
public function getFloor($x, $z){
if($this->check()){
return $this->map->getFloor($x, $z);
}
return 0;
}
public function setBlock($x, $y, $z, $block, $meta = 0){
if($this->check()){
$this->map->setBlock($x, $y, $z, $block, $meta);