From b715765053fa1eecbfc9b7e73fdc30c027eeb687 Mon Sep 17 00:00:00 2001 From: Max <43801744+ItsMax123@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:22:33 -0400 Subject: [PATCH] Fix `/f top money` (#139) --- .../PiggyFactions/commands/subcommands/TopSubCommand.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/DaPigGuy/PiggyFactions/commands/subcommands/TopSubCommand.php b/src/DaPigGuy/PiggyFactions/commands/subcommands/TopSubCommand.php index 386d4c6d..d6949e0d 100644 --- a/src/DaPigGuy/PiggyFactions/commands/subcommands/TopSubCommand.php +++ b/src/DaPigGuy/PiggyFactions/commands/subcommands/TopSubCommand.php @@ -32,14 +32,13 @@ public function onBasicRun(CommandSender $sender, array $args): void return (int)($b->getPower() - $a->getPower()); } ]; - $type = $args["type"] ?? "power"; - if (!isset($types[$type])) return; - if ($this->plugin->isFactionBankEnabled()) { $types["money"] = function (Faction $a, Faction $b): int { return (int)($b->getMoney() - $a->getMoney()); }; } + $type = $args["type"] ?? "power"; + if (!isset($types[$type])) return; $factions = array_filter($this->plugin->getFactionsManager()->getFactions(), function (Faction $faction): bool { return !$faction->getFlag(Flag::SAFEZONE) && !$faction->getFlag(Flag::WARZONE);