diff --git a/.idea/ButtonChat.iml b/.idea/ButtonChat.iml
index 73ae0d4..3d32cdf 100644
--- a/.idea/ButtonChat.iml
+++ b/.idea/ButtonChat.iml
@@ -39,33 +39,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/java/buttondevteam/chat/PluginMain.java b/src/main/java/buttondevteam/chat/PluginMain.java
index f35261b..a01632f 100644
--- a/src/main/java/buttondevteam/chat/PluginMain.java
+++ b/src/main/java/buttondevteam/chat/PluginMain.java
@@ -1,6 +1,7 @@
package buttondevteam.chat;
import buttondevteam.chat.commands.MWikiCommand;
+import buttondevteam.chat.commands.SnapCommand;
import buttondevteam.chat.commands.ucmds.HelpCommand;
import buttondevteam.chat.commands.ucmds.HistoryCommand;
import buttondevteam.chat.commands.ucmds.InfoCommand;
@@ -79,6 +80,7 @@ public class PluginMain extends ButtonPlugin { // Translated to Java: 2015.07.15
getCommand2MC().registerCommand(new InfoCommand());
getCommand2MC().registerCommand(new MWikiCommand());
getCommand2MC().registerCommand(new ReloadCommand());
+ getCommand2MC().registerCommand(new SnapCommand());
}
public static Essentials essentials = null;
diff --git a/src/main/java/buttondevteam/chat/commands/SnapCommand.java b/src/main/java/buttondevteam/chat/commands/SnapCommand.java
new file mode 100644
index 0000000..13d7cad
--- /dev/null
+++ b/src/main/java/buttondevteam/chat/commands/SnapCommand.java
@@ -0,0 +1,27 @@
+package buttondevteam.chat.commands;
+
+import buttondevteam.lib.chat.Command2;
+import buttondevteam.lib.chat.CommandClass;
+import buttondevteam.lib.chat.ICommand2MC;
+import lombok.val;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+@CommandClass(modOnly = true)
+public class SnapCommand extends ICommand2MC {
+ @Command2.Subcommand
+ public void def(CommandSender sender) {
+ val pls = new ArrayList<>(Bukkit.getOnlinePlayers());
+ int target = pls.size() / 2;
+ Random rand = new Random();
+ //noinspection SuspiciousMethodCalls
+ if (pls.remove(sender) && target > 0)
+ target--; //The sender isn't kicked, so kick someone else
+ while (pls.size() > target)
+ pls.remove(rand.nextInt(pls.size())).kickPlayer("You were saved by Thanos.");
+ sender.sendMessage(target + " grateful players remain.");
+ }
+}