diff --git a/src/pocketmine/command/defaults/TimeCommand.php b/src/pocketmine/command/defaults/TimeCommand.php index c0c9ec4d7..e988e0fe9 100644 --- a/src/pocketmine/command/defaults/TimeCommand.php +++ b/src/pocketmine/command/defaults/TimeCommand.php @@ -54,9 +54,7 @@ class TimeCommand extends VanillaCommand{ return true; } foreach($sender->getServer()->getLevels() as $level){ - $level->checkTime(); $level->startTime(); - $level->checkTime(); } Command::broadcastCommandMessage($sender, "Restarted the time"); return true; @@ -67,9 +65,7 @@ class TimeCommand extends VanillaCommand{ return true; } foreach($sender->getServer()->getLevels() as $level){ - $level->checkTime(); $level->stopTime(); - $level->checkTime(); } Command::broadcastCommandMessage($sender, "Stopped the time"); return true; @@ -109,9 +105,7 @@ class TimeCommand extends VanillaCommand{ } foreach($sender->getServer()->getLevels() as $level){ - $level->checkTime(); $level->setTime($value); - $level->checkTime(); } Command::broadcastCommandMessage($sender, new TranslationContainer("commands.time.set", [$value])); }elseif($args[0] === "add"){ @@ -123,9 +117,7 @@ class TimeCommand extends VanillaCommand{ $value = $this->getInteger($sender, $args[1], 0); foreach($sender->getServer()->getLevels() as $level){ - $level->checkTime(); $level->setTime($level->getTime() + $value); - $level->checkTime(); } Command::broadcastCommandMessage($sender, new TranslationContainer("commands.time.added", [$value])); }else{ diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 80b1cd38a..b8231d979 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -653,18 +653,6 @@ class Level implements ChunkManager, Metadatable{ } } - /** - * WARNING: Do not use this, it's only for internal use. - * Changes to this function won't be recorded on the version. - */ - public function checkTime(){ - if($this->stopTime){ - return; - }else{ - ++$this->time; - } - } - /** * WARNING: Do not use this, it's only for internal use. * Changes to this function won't be recorded on the version. @@ -696,7 +684,9 @@ class Level implements ChunkManager, Metadatable{ $this->timings->doTick->startTiming(); - $this->checkTime(); + if(!$this->stopTime){ + $this->time++; + } $this->sunAnglePercentage = $this->computeSunAnglePercentage(); //Sun angle depends on the current time $this->skyLightReduction = $this->computeSkyLightReduction(); //Sky light reduction depends on the sun angle