From 1b572d3e404d30001fcc52570250f822b3097b33 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 13 Oct 2018 15:43:43 +0100 Subject: [PATCH] Level: rename unload to onUnload() again, this is an intentional rug-jerk, along with a clearer naming. --- src/pocketmine/Server.php | 2 +- src/pocketmine/level/Level.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 2f1f5b818..2dedebf33 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -999,7 +999,7 @@ class Server{ throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels."); } - return $level->unload($forceUnload); + return $level->onUnload($forceUnload); } /** diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 2ef63effc..eb1356983 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -529,14 +529,12 @@ class Level implements ChunkManager, Metadatable{ /** * @internal DO NOT use this from plugins, it's for internal use only. Use Server->unloadLevel() instead. * - * Unloads the current level from memory safely - * * @param bool $force default false, force unload of default level * * @return bool * @throws \InvalidStateException if trying to unload a level during level tick */ - public function unload(bool $force = false) : bool{ + public function onUnload(bool $force = false) : bool{ if($this->doingTick and !$force){ throw new \InvalidStateException("Cannot unload a level during level tick"); }