Level: throw exceptions on bad positions in setBlock()

This commit is contained in:
Dylan K. Taylor 2018-10-28 16:42:16 +00:00
parent 7607e484dd
commit a6c31b72ae

View File

@ -1511,7 +1511,7 @@ class Level implements ChunkManager, Metadatable{
public function setBlock(Vector3 $pos, Block $block, bool $update = true) : bool{
$pos = $pos->floor();
if(!$this->isInWorld($pos->x, $pos->y, $pos->z)){
return false;
throw new \InvalidArgumentException("Pos x=$pos->x,y=$pos->y,z=$pos->z is outside of the world bounds");
}
$this->timings->setBlock->startTiming();