diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..cf1b22d --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,9 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +/misc.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..d843f34 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index 1b754a9..bce7661 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,24 @@ -BungeeKickMove -============== \ No newline at end of file +MoveMeNow +---- + +This is a port of the known [MoveMeNow](https://www.spigotmc.org/resources/movemenow.17/)-Plugin from SpigotMC, to use on BungeeCord-Proxies. It will move a player, when he gets kicked, to a predefined other server on the proxy, based on a white/blacklist. +#### Configuration: +```yml +message: "%kickmsg%" +servername: "server2" +mode: whitelist +list: +- ban +- kick +``` +> [!NOTE] +> Mode can either be blacklist or whitelist. In blacklist mode, player will always be moved to default server unless his kick message contains one of the words/phrases in list. In whitelist mode, he will always be kicked unless his kick message contains one of the phrases in list. The servername is the name of the server (in the bungee config) to kick to. +> +> Message is the message sent to the player when he switches server. It can be spanned over multiple lines using the following syntax: +> ```yml +> message: | +> "This is the first line" +> "%kickmsg%" +> "This is the third line" +> ``` +> The `%kickmsg%` will be replaced by the reason the server kicked the user in the first place. diff --git a/pom.xml b/pom.xml index ac2ac39..111173b 100644 --- a/pom.xml +++ b/pom.xml @@ -8,15 +8,17 @@ 1.2 - dev-cmc - http://nexus.cmc.im/content/groups/public/ + bungeecord-repo + https://oss.sonatype.org/content/repositories/snapshots net.md-5 bungeecord-api - 1.7-SNAPSHOT + 1.21-R0.1-SNAPSHOT + jar + provided @@ -33,8 +35,8 @@ maven-compiler-plugin 3.0 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/src/main/java/net/craftminecraft/bungee/movemenow/ReloadCommand.java b/src/main/java/net/craftminecraft/bungee/movemenow/ReloadCommand.java index 69a4e80..e6e2b95 100644 --- a/src/main/java/net/craftminecraft/bungee/movemenow/ReloadCommand.java +++ b/src/main/java/net/craftminecraft/bungee/movemenow/ReloadCommand.java @@ -1,11 +1,12 @@ package net.craftminecraft.bungee.movemenow; -import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.plugin.Command; +import net.md_5.bungee.api.plugin.TabExecutor; +import java.util.ArrayList; -public class ReloadCommand extends Command { +public class ReloadCommand extends Command implements TabExecutor { MoveMeNow plugin; public ReloadCommand(MoveMeNow plugin) { @@ -17,10 +18,19 @@ public ReloadCommand(MoveMeNow plugin) { public void execute(CommandSender sender, String[] args) { if (args.length != 1) { sender.sendMessage(new TextComponent("Please use /mmn reload.")); + return; } - switch (args[0]) { - case "reload": - plugin.loadConfig(); + if (args[0].equals("reload")) { + plugin.loadConfig(); + sender.sendMessage(new TextComponent("Reloaded config!")); } } + + @Override + public Iterable onTabComplete(CommandSender sender, String[] args) + { + ArrayList list = new ArrayList<>(); + list.add("reload"); + return list; + } } \ No newline at end of file