Skip to content

Commit

Permalink
Fix /f top money (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMax123 authored Apr 24, 2024
1 parent 1c2c73f commit b715765
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b715765

Please sign in to comment.