mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Level: throw exceptions on bad positions in setBlock()
This commit is contained in:
parent
7607e484dd
commit
a6c31b72ae
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user