Fix for block updates

This commit is contained in:
Shoghi Cervantes Pueyo
2013-01-04 01:32:06 +01:00
parent b9eca491e8
commit 52b4220ade
2 changed files with 17 additions and 15 deletions

View File

@@ -85,7 +85,7 @@ class LevelAPI{
return $this->heightMap[$z][$x];
}
public function setBlock($x, $y, $z, $block, $meta = 0){
public function setBlock($x, $y, $z, $block, $meta = 0, $update = true){
$this->map->setBlock($x, $y, $z, $block, $meta);
$this->heightMap[$z][$x] = $this->map->getFloor($x, $z);
if($this->server->api->dhandle("world.block.change", array(
@@ -95,8 +95,10 @@ class LevelAPI{
"block" => $block,
"meta" => $meta,
)) !== false){
$this->server->api->block->updateBlock($x, $y, $z, BLOCK_UPDATE_NORMAL);
$this->server->api->block->updateBlocksAround($x, $y, $z, BLOCK_UPDATE_NORMAL);
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);
}
}
}