From e74e6c3f77fe57c1ef8ed243feb50ce1839a8a31 Mon Sep 17 00:00:00 2001 From: ArkQuark <74979909+ArkQuark@users.noreply.github.com> Date: Wed, 8 Jun 2022 17:50:46 +0300 Subject: [PATCH] Update BlockAPI.php fixed /setblock --- src/API/BlockAPI.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index fbe8f3f4..c07f0640 100755 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -295,31 +295,27 @@ class BlockAPI{ } if(count($args) < 4){ - console('oof'); $output .= "Usage: /setblock \n"; break; } - if($args[0] == '~') $x = $issuer->entity->x; + if($args[0] == '~') $x = round($issuer->entity->x, 0); elseif((int)$args[0] < 255) $x = $args[0]; else{ - console('oof1'); $output .= "Usage: /setblock \n"; break; } - if($args[1] == '~') $y = $issuer->entity->y; + if($args[1] == '~') $y = round($issuer->entity->y, 0); elseif((int)$args[1] < 255) $y = $args[1]; else{ - console('oof2'); $output .= "Usage: /setblock \n"; break; } - if($args[2] == '~') $z = $issuer->entity->z; + if($args[2] == '~') $z = round($issuer->entity->z, 0); elseif((int)$args[2] < 255) $z = $args[2]; else{ - console('oof3'); $output .= "Usage: /setblock \n"; break; } @@ -327,13 +323,12 @@ class BlockAPI{ $pos = new Position($x, $y, $z, $issuer->entity->level); $block = BlockAPI::fromString($args[3])->getBlock(); if(!($block instanceof Block)){ - console('oof4'); $output .= "Usage: /setblock \n"; break; } else{ $issuer->level->setBlock($pos, $block, true, false, true); - $output .= "Placed a block in ".$x.", ".$y.", ".$z.", with id ".$args[3]; + $output .= "Placed ".$block." in ".$x.", ".$y.", ".$z; } break; case "give":