From 7b73f73561b7abbe85530a2abb35a2968f879139 Mon Sep 17 00:00:00 2001 From: Aaron Brock Date: Sun, 5 Jul 2015 03:58:46 -0400 Subject: [PATCH] Switched updateTypes to use the key instead of the value. Signed-off-by: Aaron Brock --- .../bench/game/components/lobby/LobbyComponent.php | 2 +- .../src/mineplex/plugin/core/updater/UpdateEvent.php | 10 +--------- .../src/mineplex/plugin/core/updater/Updater.php | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Pocket/plugins/Mineplex/src/mineplex/plugin/bench/game/components/lobby/LobbyComponent.php b/Pocket/plugins/Mineplex/src/mineplex/plugin/bench/game/components/lobby/LobbyComponent.php index 044279afd..43a3941a4 100644 --- a/Pocket/plugins/Mineplex/src/mineplex/plugin/bench/game/components/lobby/LobbyComponent.php +++ b/Pocket/plugins/Mineplex/src/mineplex/plugin/bench/game/components/lobby/LobbyComponent.php @@ -41,7 +41,7 @@ class LobbyComponent implements Listener { */ public function __construct(Arena $arena, $world = null) { - + if ($world == null) $world = Server::getInstance()->getDefaultLevel(); diff --git a/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/UpdateEvent.php b/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/UpdateEvent.php index f45e103d6..942455136 100644 --- a/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/UpdateEvent.php +++ b/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/UpdateEvent.php @@ -30,14 +30,6 @@ class UpdateEvent extends Event public function isTiming($type) { - foreach ($this->updateTypes as $updateType) - { - if ($updateType->isTiming($type)) - { - return true; - } - } - - return false; + return (isset($this->updateTypes[$type]) || array_key_exists($type, $this->updateTypes)); } } \ No newline at end of file diff --git a/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/Updater.php b/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/Updater.php index 9fd2d4735..d843920fc 100644 --- a/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/Updater.php +++ b/Pocket/plugins/Mineplex/src/mineplex/plugin/core/updater/Updater.php @@ -51,7 +51,7 @@ class Updater extends PluginTask { if ($updateType->canTrigger()) { - array_push($updateTypes, $updateType); + $updateTypes[$updateType] = 1; } } //Call Event