Skip to content

Commit

Permalink
Add reset-all command (#35)
Browse files Browse the repository at this point in the history
* Add reset-all command

* Add reset-all command permission to plugin.yml
  • Loading branch information
JackNoordhuis authored and falkirks committed Jan 26, 2017
1 parent 59c93e6 commit 27fe1c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ permissions:
description: Reset mines
minereset.command.destroy:
description: Remove mines
minereset.command.reset-all:
description: Reset all mines
10 changes: 10 additions & 0 deletions src/minereset/MineReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 27fe1c8

Please sign in to comment.