Add missing return value, fix blocks vanishing when placed

This commit is contained in:
Dylan K. Taylor 2016-11-17 19:12:24 +00:00
parent 4c49db6036
commit 15f7cfb4f7
2 changed files with 4 additions and 3 deletions

View File

@ -79,8 +79,9 @@ interface Chunk{
* @param int $blockId , if null, do not change
* @param int $meta 0-15, if null, do not change
*
* @return bool
*/
public function setBlock(int $x, int $y, int $z, $blockId = null, $meta = null);
public function setBlock(int $x, int $y, int $z, $blockId = null, $meta = null) : bool;
/**
* @param int $x 0-15

View File

@ -163,8 +163,8 @@ class GenericChunk implements Chunk{
return $this->getSubChunk($y >> 4)->getFullBlock($x, $y & 0x0f, $z);
}
public function setBlock(int $x, int $y, int $z, $blockId = null, $meta = null){
$this->getSubChunk($y >> 4, true)->setBlock($x, $y & 0x0f, $z, $blockId !== null ? ($blockId & 0xff) : null, $meta !== null ? ($meta & 0x0f) : null);
public function setBlock(int $x, int $y, int $z, $blockId = null, $meta = null) : bool{
return $this->getSubChunk($y >> 4, true)->setBlock($x, $y & 0x0f, $z, $blockId !== null ? ($blockId & 0xff) : null, $meta !== null ? ($meta & 0x0f) : null);
}
public function getBlockId(int $x, int $y, int $z) : int{