mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Add missing return value, fix blocks vanishing when placed
This commit is contained in:
parent
4c49db6036
commit
15f7cfb4f7
@ -79,8 +79,9 @@ interface Chunk{
|
|||||||
* @param int $blockId , if null, do not change
|
* @param int $blockId , if null, do not change
|
||||||
* @param int $meta 0-15, 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
|
* @param int $x 0-15
|
||||||
|
@ -163,8 +163,8 @@ class GenericChunk implements Chunk{
|
|||||||
return $this->getSubChunk($y >> 4)->getFullBlock($x, $y & 0x0f, $z);
|
return $this->getSubChunk($y >> 4)->getFullBlock($x, $y & 0x0f, $z);
|
||||||
}
|
}
|
||||||
|
|
||||||
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{
|
||||||
$this->getSubChunk($y >> 4, true)->setBlock($x, $y & 0x0f, $z, $blockId !== null ? ($blockId & 0xff) : null, $meta !== null ? ($meta & 0x0f) : null);
|
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{
|
public function getBlockId(int $x, int $y, int $z) : int{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user