mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
Updated Level::setMiniChunk() and Level::setRawBlock
This commit is contained in:
parent
48b5afac46
commit
95f2f347ff
1 changed files with 10 additions and 1 deletions
|
|
@ -206,7 +206,15 @@ class Level{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockRaw(Vector3 $pos, Block $block){
|
public function setBlockRaw(Vector3 $pos, Block $block){
|
||||||
return $this->level->setBlock($pos->x, $pos->y, $pos->z, $block->getID(), $block->getMetadata());
|
if(($ret = $this->level->setBlock($pos->x, $pos->y, $pos->z, $block->getID(), $block->getMetadata())) === true){
|
||||||
|
if(!isset($this->changedBlocks[$i])){
|
||||||
|
$this->changedBlocks[$i] = array();
|
||||||
|
$this->changedCount[$i] = 0;
|
||||||
|
}
|
||||||
|
$this->changedBlocks[$i][] = $block;
|
||||||
|
++$this->changedCount[$i];
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBlock(Vector3 $pos, Block $block, $update = true, $tiles = false){
|
public function setBlock(Vector3 $pos, Block $block, $update = true, $tiles = false){
|
||||||
|
|
@ -250,6 +258,7 @@ class Level{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMiniChunk($X, $Y, $Z, $data){
|
public function setMiniChunk($X, $Y, $Z, $data){
|
||||||
|
$this->changedCount[$X.":".$Y.":".$Z] = 4096;
|
||||||
return $this->level->setMiniChunk($X, $Y, $Z, $data);
|
return $this->level->setMiniChunk($X, $Y, $Z, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue