diff --git a/plugin.yml b/plugin.yml index 782d83d..ae33934 100644 --- a/plugin.yml +++ b/plugin.yml @@ -24,3 +24,5 @@ permissions: description: Reset mines minereset.command.destroy: description: Remove mines + minereset.command.reset-all: + description: Reset all mines diff --git a/src/minereset/MineReset.php b/src/minereset/MineReset.php index 97bebd7..f048520 100644 --- a/src/minereset/MineReset.php +++ b/src/minereset/MineReset.php @@ -146,6 +146,16 @@ public function onCommand(CommandSender $sender, Command $cmd, $label, array $ar return true; } break; + case "reset-all": + $i = 0; + foreach($this->mines as $mine) { + if($mine->isMineSet()) { + $mine->resetMine(); + $i++; + } + } + $sender->sendMessage("Resetting {$i} mines."); + return true; case "longreset": case "lr": $sender->sendMessage(TextFormat::RED . "Long resetting is no longer supported, if you need it use an older version." . TextFormat::RESET);