From d3f53868122d1414244b7a3a72d5acc2ebe8f8fe Mon Sep 17 00:00:00 2001 From: Sunch <120295462+Sunch233@users.noreply.github.com> Date: Sat, 17 Aug 2024 20:05:28 +0800 Subject: [PATCH] Unnecessary return/continue --- src/Player.php | 3 +-- src/entity/Entity.php | 3 +-- src/entity/object/Arrow.php | 3 +-- src/functions.php | 3 +-- src/material/block/solid/GrassBlock.php | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Player.php b/src/Player.php index ba0f6879..6edcbe95 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1037,8 +1037,7 @@ class Player{ } } } - return; - reset_spawn_pos: + reset_spawn_pos: $this->spawnPosition = $this->server->api->level->getDefault()->getSpawn(); } } diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 7211dd2c..7d6db460 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1496,8 +1496,7 @@ class Entity extends Position { if($this->class === ENTITY_PLAYER){ $this->player->teleport(new Vector3($this->x, $this->y, $this->z), false, false, true, false); - return; - } + } } public function moveEntityWithOffset($oX, $oY, $oZ) diff --git a/src/entity/object/Arrow.php b/src/entity/object/Arrow.php index c2213d94..1b84c920 100644 --- a/src/entity/object/Arrow.php +++ b/src/entity/object/Arrow.php @@ -139,8 +139,7 @@ class Arrow extends Entity{ ++$this->groundTicks; if($this->groundTicks >= 1200){ //TODO customizeable? $this->close(); - return; - } + } }else{ $this->inGround = false; $this->speedX *= lcg_value() * 0.2; diff --git a/src/functions.php b/src/functions.php index 90632ecd..a28959f0 100644 --- a/src/functions.php +++ b/src/functions.php @@ -162,9 +162,8 @@ function arguments($args){ } $ret['input'][] = $arg; - continue; - } + } return $ret; } diff --git a/src/material/block/solid/GrassBlock.php b/src/material/block/solid/GrassBlock.php index fdeee837..66d4ddbe 100644 --- a/src/material/block/solid/GrassBlock.php +++ b/src/material/block/solid/GrassBlock.php @@ -45,8 +45,7 @@ class GrassBlock extends SolidBlock{ ServerAPI::request()->api->entity->drop(new Position($this->x+0.5, $this->y+1, $this->z+0.5, $this->level), BlockAPI::getItem(295,0,1)); return; } - return; - } + } public static function onRandomTick(Level $level, $x, $y, $z){ if(!StaticBlock::getIsTransparent($level->level->getBlockID($x, $y + 1, $z)) && mt_rand(0, 2) == 1){ $level->fastSetBlockUpdate($x, $y, $z, DIRT, 0);