Improved block updates and Scheduled block updates [part1]

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-16 17:15:39 +02:00
parent 3c40c8734f
commit 710ed5c704
4 changed files with 78 additions and 20 deletions

View file

@ -69,7 +69,7 @@ class LevelAPI{
return $this->heightMap[$z][$x];
}
public function setBlock($x, $y, $z, $block, $meta = 0, $update = true, $tiles = false){
public function setBlock($x, $y, $z, $block, $meta = 0){
if($x < 0 or $y < 0 or $z < 0){
return false;
}
@ -82,15 +82,6 @@ class LevelAPI{
)) !== false){
$this->map->setBlock($x, $y, $z, $block, $meta);
$this->heightMap[$z][$x] = $this->map->getFloor($x, $z);
if($update === true){
$this->server->api->block->updateBlock($x, $y, $z, BLOCK_UPDATE_NORMAL);
$this->server->api->block->updateBlocksAround($x, $y, $z, BLOCK_UPDATE_NORMAL);
}
if($tiles === true){
if(($t = $this->server->api->tileentity->get($x, $y, $z)) !== false){
$t[0]->close();
}
}
}
return true;
}