Placing Signs

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-28 19:01:41 +01:00
parent df46e241d3
commit 8a5708f47a
5 changed files with 45 additions and 1 deletions

View file

@ -70,8 +70,22 @@ class TileEntityAPI{
public function add($class, $x, $y, $z, $data = array()){
$id = $this->tCnt++;
$this->server->tileEntities[$id] = new TileEntity($this->server, $id, $class, $x, $y, $z, $data);
$this->spawnToAll($id);
return $this->server->tileEntities[$id];
}
public function addSign($x, $y, $z, $lines = array("", "", "", "")){
return $this->add(TILE_SIGN, $x, $y, $z, $data = array(
"id" => "Sign",
"x" => $x,
"y" => $y,
"z" => $z,
"Text1" => $lines[0],
"Text2" => $lines[1],
"Text3" => $lines[2],
"Text4" => $lines[3],
));
}
public function spawnTo($id, $player){
$t = $this->getByID($id);