From 4be58a7c009fd4d1692c5ffdef40deb56be44c1a Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 10 Jan 2014 09:53:33 +1100 Subject: [PATCH] Copy across all the commands and add their bootstrap plugins. --- module/cmd-alert/nb-configuration.xml | 31 +++++++++++++++++++ .../module/cmd/alert}/CommandAlert.java | 3 +- .../module/cmd/alert}/CommandAlertRaw.java | 5 ++- .../bungee/module/cmd/alert/PluginAlert.java | 12 +++++++ .../cmd-alert/src/main/resources/plugin.yml | 4 +-- module/cmd-find/nb-configuration.xml | 31 +++++++++++++++++++ .../bungee/module/cmd/find}/CommandFind.java | 4 +-- .../bungee/module/cmd/find/PluginFind.java | 13 ++++++++ module/cmd-find/src/main/resources/plugin.yml | 4 +-- module/cmd-list/nb-configuration.xml | 31 +++++++++++++++++++ .../bungee/module/cmd/list}/CommandList.java | 2 +- .../bungee/module/cmd/list/PluginList.java | 13 ++++++++ module/cmd-list/src/main/resources/plugin.yml | 4 +-- module/cmd-send/nb-configuration.xml | 31 +++++++++++++++++++ .../bungee/module/cmd/send}/CommandSend.java | 2 +- .../bungee/module/cmd/send/PluginSend.java | 13 ++++++++ module/cmd-send/src/main/resources/plugin.yml | 4 +-- module/cmd-server/nb-configuration.xml | 31 +++++++++++++++++++ .../module/cmd/server}/CommandServer.java | 2 +- .../module/cmd/server/PluginServer.java | 13 ++++++++ .../cmd-server/src/main/resources/plugin.yml | 4 +-- module/pom.xml | 11 ++++++- .../main/java/net/md_5/bungee/BungeeCord.java | 6 ---- 23 files changed, 247 insertions(+), 27 deletions(-) create mode 100644 module/cmd-alert/nb-configuration.xml rename {proxy/src/main/java/net/md_5/bungee/command => module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert}/CommandAlert.java (93%) rename {proxy/src/main/java/net/md_5/bungee/command => module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert}/CommandAlertRaw.java (91%) create mode 100644 module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/PluginAlert.java create mode 100644 module/cmd-find/nb-configuration.xml rename {proxy/src/main/java/net/md_5/bungee/command => module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find}/CommandFind.java (91%) create mode 100644 module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find/PluginFind.java create mode 100644 module/cmd-list/nb-configuration.xml rename {proxy/src/main/java/net/md_5/bungee/command => module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list}/CommandList.java (97%) create mode 100644 module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/PluginList.java create mode 100644 module/cmd-send/nb-configuration.xml rename {proxy/src/main/java/net/md_5/bungee/command => module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send}/CommandSend.java (98%) create mode 100644 module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/PluginSend.java create mode 100644 module/cmd-server/nb-configuration.xml rename {proxy/src/main/java/net/md_5/bungee/command => module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server}/CommandServer.java (98%) create mode 100644 module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/PluginServer.java diff --git a/module/cmd-alert/nb-configuration.xml b/module/cmd-alert/nb-configuration.xml new file mode 100644 index 00000000..7e465924 --- /dev/null +++ b/module/cmd-alert/nb-configuration.xml @@ -0,0 +1,31 @@ + + + + + + project + NEW_LINE + NEW_LINE + NEW_LINE + true + true + true + true + true + true + true + true + true + true + + diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java b/module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/CommandAlert.java similarity index 93% rename from proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java rename to module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/CommandAlert.java index 1ccae73b..e3bdbc4b 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java +++ b/module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/CommandAlert.java @@ -1,9 +1,8 @@ -package net.md_5.bungee.command; +package net.md_5.bungee.module.cmd.alert; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; -import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.plugin.Command; public class CommandAlert extends Command diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandAlertRaw.java b/module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/CommandAlertRaw.java similarity index 91% rename from proxy/src/main/java/net/md_5/bungee/command/CommandAlertRaw.java rename to module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/CommandAlertRaw.java index 0422e564..24da97b6 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandAlertRaw.java +++ b/module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/CommandAlertRaw.java @@ -1,4 +1,4 @@ -package net.md_5.bungee.command; +package net.md_5.bungee.module.cmd.alert; import com.google.common.base.Joiner; import net.md_5.bungee.api.ChatColor; @@ -43,8 +43,7 @@ public class CommandAlertRaw extends Command sender.sendMessage( new ComponentBuilder( "An error occurred while parsing your message. (Hover for details)" ). color( ChatColor.RED ).underlined( true ). - event( new HoverEvent( HoverEvent.Action.SHOW_TEXT, - new ComponentBuilder( error.getMessage() ).color( ChatColor.RED ).create() ) ). + event( new HoverEvent( HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( error.getMessage() ).color( ChatColor.RED ).create() ) ). create() ); } else { diff --git a/module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/PluginAlert.java b/module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/PluginAlert.java new file mode 100644 index 00000000..d743c544 --- /dev/null +++ b/module/cmd-alert/src/main/java/net/md_5/bungee/module/cmd/alert/PluginAlert.java @@ -0,0 +1,12 @@ +package net.md_5.bungee.module.cmd.alert; + +import net.md_5.bungee.api.plugin.Plugin; + +public class PluginAlert extends Plugin { + + @Override + public void onEnable() { + getProxy().getPluginManager().registerCommand(this, new CommandAlert()); + getProxy().getPluginManager().registerCommand(this, new CommandAlertRaw()); + } +} diff --git a/module/cmd-alert/src/main/resources/plugin.yml b/module/cmd-alert/src/main/resources/plugin.yml index 809847f6..b495b3ab 100644 --- a/module/cmd-alert/src/main/resources/plugin.yml +++ b/module/cmd-alert/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: ${project.name} -main: foo +main: net.md_5.bungee.module.cmd.alert.PluginAlert version: ${describe} -description: ${project.description} \ No newline at end of file +description: ${project.description} diff --git a/module/cmd-find/nb-configuration.xml b/module/cmd-find/nb-configuration.xml new file mode 100644 index 00000000..7e465924 --- /dev/null +++ b/module/cmd-find/nb-configuration.xml @@ -0,0 +1,31 @@ + + + + + + project + NEW_LINE + NEW_LINE + NEW_LINE + true + true + true + true + true + true + true + true + true + true + + diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandFind.java b/module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find/CommandFind.java similarity index 91% rename from proxy/src/main/java/net/md_5/bungee/command/CommandFind.java rename to module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find/CommandFind.java index 10e99d7a..728b9b64 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandFind.java +++ b/module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find/CommandFind.java @@ -1,10 +1,10 @@ -package net.md_5.bungee.command; +package net.md_5.bungee.module.cmd.find; -import java.util.Collections; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; +import net.md_5.bungee.command.PlayerCommand; public class CommandFind extends PlayerCommand { diff --git a/module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find/PluginFind.java b/module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find/PluginFind.java new file mode 100644 index 00000000..63757214 --- /dev/null +++ b/module/cmd-find/src/main/java/net/md_5/bungee/module/cmd/find/PluginFind.java @@ -0,0 +1,13 @@ +package net.md_5.bungee.module.cmd.find; + +import net.md_5.bungee.api.plugin.Plugin; + +public class PluginFind extends Plugin +{ + + @Override + public void onEnable() + { + getProxy().getPluginManager().registerCommand( this, new CommandFind() ); + } +} diff --git a/module/cmd-find/src/main/resources/plugin.yml b/module/cmd-find/src/main/resources/plugin.yml index 809847f6..8c536603 100644 --- a/module/cmd-find/src/main/resources/plugin.yml +++ b/module/cmd-find/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: ${project.name} -main: foo +main: net.md_5.bungee.module.cmd.find.PluginFind version: ${describe} -description: ${project.description} \ No newline at end of file +description: ${project.description} diff --git a/module/cmd-list/nb-configuration.xml b/module/cmd-list/nb-configuration.xml new file mode 100644 index 00000000..7e465924 --- /dev/null +++ b/module/cmd-list/nb-configuration.xml @@ -0,0 +1,31 @@ + + + + + + project + NEW_LINE + NEW_LINE + NEW_LINE + true + true + true + true + true + true + true + true + true + true + + diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java similarity index 97% rename from proxy/src/main/java/net/md_5/bungee/command/CommandList.java rename to module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java index ae65f9df..c2227110 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandList.java +++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java @@ -1,4 +1,4 @@ -package net.md_5.bungee.command; +package net.md_5.bungee.module.cmd.list; import java.util.ArrayList; import java.util.Collections; diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/PluginList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/PluginList.java new file mode 100644 index 00000000..e2a196c1 --- /dev/null +++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/PluginList.java @@ -0,0 +1,13 @@ +package net.md_5.bungee.module.cmd.list; + +import net.md_5.bungee.api.plugin.Plugin; + +public class PluginList extends Plugin +{ + + @Override + public void onEnable() + { + getProxy().getPluginManager().registerCommand( this, new CommandList() ); + } +} diff --git a/module/cmd-list/src/main/resources/plugin.yml b/module/cmd-list/src/main/resources/plugin.yml index 809847f6..47400087 100644 --- a/module/cmd-list/src/main/resources/plugin.yml +++ b/module/cmd-list/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: ${project.name} -main: foo +main: net.md_5.bungee.module.cmd.list.PluginList version: ${describe} -description: ${project.description} \ No newline at end of file +description: ${project.description} diff --git a/module/cmd-send/nb-configuration.xml b/module/cmd-send/nb-configuration.xml new file mode 100644 index 00000000..7e465924 --- /dev/null +++ b/module/cmd-send/nb-configuration.xml @@ -0,0 +1,31 @@ + + + + + + project + NEW_LINE + NEW_LINE + NEW_LINE + true + true + true + true + true + true + true + true + true + true + + diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandSend.java b/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/CommandSend.java similarity index 98% rename from proxy/src/main/java/net/md_5/bungee/command/CommandSend.java rename to module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/CommandSend.java index 527914fe..8a108aa3 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandSend.java +++ b/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/CommandSend.java @@ -1,4 +1,4 @@ -package net.md_5.bungee.command; +package net.md_5.bungee.module.cmd.send; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; diff --git a/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/PluginSend.java b/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/PluginSend.java new file mode 100644 index 00000000..4d4cf822 --- /dev/null +++ b/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/PluginSend.java @@ -0,0 +1,13 @@ +package net.md_5.bungee.module.cmd.send; + +import net.md_5.bungee.api.plugin.Plugin; + +public class PluginSend extends Plugin +{ + + @Override + public void onEnable() + { + getProxy().getPluginManager().registerCommand( this, new CommandSend() ); + } +} diff --git a/module/cmd-send/src/main/resources/plugin.yml b/module/cmd-send/src/main/resources/plugin.yml index 809847f6..c148619f 100644 --- a/module/cmd-send/src/main/resources/plugin.yml +++ b/module/cmd-send/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: ${project.name} -main: foo +main: net.md_5.bungee.module.cmd.send.PluginSend version: ${describe} -description: ${project.description} \ No newline at end of file +description: ${project.description} diff --git a/module/cmd-server/nb-configuration.xml b/module/cmd-server/nb-configuration.xml new file mode 100644 index 00000000..7e465924 --- /dev/null +++ b/module/cmd-server/nb-configuration.xml @@ -0,0 +1,31 @@ + + + + + + project + NEW_LINE + NEW_LINE + NEW_LINE + true + true + true + true + true + true + true + true + true + true + + diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java similarity index 98% rename from proxy/src/main/java/net/md_5/bungee/command/CommandServer.java rename to module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java index 5ee09a37..842565b9 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java +++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java @@ -1,4 +1,4 @@ -package net.md_5.bungee.command; +package net.md_5.bungee.module.cmd.server; import com.google.common.base.Function; import com.google.common.base.Predicate; diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/PluginServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/PluginServer.java new file mode 100644 index 00000000..4aaae7ec --- /dev/null +++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/PluginServer.java @@ -0,0 +1,13 @@ +package net.md_5.bungee.module.cmd.server; + +import net.md_5.bungee.api.plugin.Plugin; + +public class PluginServer extends Plugin +{ + + @Override + public void onEnable() + { + getProxy().getPluginManager().registerCommand( this, new CommandServer() ); + } +} diff --git a/module/cmd-server/src/main/resources/plugin.yml b/module/cmd-server/src/main/resources/plugin.yml index 809847f6..958e6294 100644 --- a/module/cmd-server/src/main/resources/plugin.yml +++ b/module/cmd-server/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: ${project.name} -main: foo +main: net.md_5.bungee.module.cmd.server.PluginServer version: ${describe} -description: ${project.description} \ No newline at end of file +description: ${project.description} diff --git a/module/pom.xml b/module/pom.xml index a35955c9..230b89aa 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -15,7 +15,7 @@ 1.7-SNAPSHOT pom - BungeeCord + BungeeCord Modules Parent project for all BungeeCord modules. @@ -26,6 +26,15 @@ cmd-server + + + net.md-5 + bungeecord-api + ${project.version} + compile + + + ${project.name} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index 3d519e06..20cf0ce1 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -130,15 +130,9 @@ public class BungeeCord extends ProxyServer // TODO: Proper fallback when we interface the manager getPluginManager().registerCommand( null, new CommandReload() ); getPluginManager().registerCommand( null, new CommandEnd() ); - getPluginManager().registerCommand( null, new CommandList() ); - getPluginManager().registerCommand( null, new CommandServer() ); getPluginManager().registerCommand( null, new CommandIP() ); - getPluginManager().registerCommand( null, new CommandAlert() ); getPluginManager().registerCommand( null, new CommandBungee() ); getPluginManager().registerCommand( null, new CommandPerms() ); - getPluginManager().registerCommand( null, new CommandSend() ); - getPluginManager().registerCommand( null, new CommandFind() ); - getPluginManager().registerCommand( null, new CommandAlertRaw() ); registerChannel( "BungeeCord" ); }