Sign placing improvement

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-28 19:06:39 +01:00
parent 8a5708f47a
commit fe3be181e8
3 changed files with 5 additions and 5 deletions

View File

@ -87,12 +87,12 @@ class TileEntityAPI{
)); ));
} }
public function spawnTo($id, $player){ public function spawnTo($id, $player, $queue = false){
$t = $this->getByID($id); $t = $this->getByID($id);
if($t === false){ if($t === false){
return false; return false;
} }
$t->spawn($player); $t->spawn($player, $queue);
} }
public function spawnToAll($id){ public function spawnToAll($id){

View File

@ -515,7 +515,7 @@ class Player{
$tiles = $this->server->query("SELECT * FROM tileentities WHERE spawnable = 1 AND x >= '.$x.' AND x < '.($x + 16).' AND z >= '.$z.' AND z < '.($z + 16).';"); $tiles = $this->server->query("SELECT * FROM tileentities WHERE spawnable = 1 AND x >= '.$x.' AND x < '.($x + 16).' AND z >= '.$z.' AND z < '.($z + 16).';");
if($tiles !== false and $tiles !== true){ if($tiles !== false and $tiles !== true){
while(($tile = $tiles->fetchArray(SQLITE3_ASSOC)) !== false){ while(($tile = $tiles->fetchArray(SQLITE3_ASSOC)) !== false){
$this->server->api->tileentity->spawnTo($tile["ID"], "'.$this->username.'"); $this->server->api->tileentity->spawnTo($tile["ID"], "'.$this->username.'", true);
} }
} }
'); ');

View File

@ -71,7 +71,7 @@ class TileEntity extends stdClass{
} }
} }
public function spawn($player){ public function spawn($player, $queue = false){
if($this->closed){ if($this->closed){
return false; return false;
} }
@ -88,7 +88,7 @@ class TileEntity extends stdClass{
"line1" => $this->data["Text2"], "line1" => $this->data["Text2"],
"line2" => $this->data["Text3"], "line2" => $this->data["Text3"],
"line3" => $this->data["Text4"], "line3" => $this->data["Text4"],
), true); ), $queue);
break; break;
} }
} }