mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
small php8 tweaks
This commit is contained in:
parent
ad8cbb81ff
commit
92e56c6049
2 changed files with 5 additions and 2 deletions
|
|
@ -504,10 +504,13 @@ class Level{
|
|||
}
|
||||
|
||||
public function setBlock(Vector3 $pos, Block $block, $update = true, $tiles = false, $direct = false){
|
||||
$pos->x = (int)$pos->x;
|
||||
$pos->y = (int)$pos->y;
|
||||
$pos->z = (int)$pos->z;
|
||||
if(!isset($this->level) or (($pos instanceof Position) and $pos->level !== $this) or $pos->y < 0){
|
||||
return false;
|
||||
}
|
||||
$ret = $this->level->setBlock($pos->x, $pos->y, $pos->z, $block->getID(), $block->getMetadata());
|
||||
$ret = $this->level->setBlock((int)$pos->x, (int)$pos->y, (int)$pos->z, $block->getID(), $block->getMetadata());
|
||||
if($ret === true){
|
||||
if(!($pos instanceof Position)){
|
||||
$pos = new Position($pos->x, $pos->y, $pos->z, $this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue