From 5da1e41206d8f42f67e835bc9a90b5176ff911ec Mon Sep 17 00:00:00 2001 From: Simon Giesel Date: Fri, 20 Sep 2019 07:35:55 +0200 Subject: [PATCH] Initial commit --- .idea/.gitignore | 2 + .idea/compiler.xml | 13 ++++++ .idea/dictionaries/simon.xml | 7 ++++ .idea/encodings.xml | 6 +++ .idea/misc.xml | 14 +++++++ .idea/saveactions_settings.xml | 13 ++++++ .idea/vcs.xml | 6 +++ CliffbreakHub.iml | 2 + pom.xml | 42 +++++++++++++++++++ .../java/de/cliffbreak/hub/CliffbreakHub.java | 32 ++++++++++++++ src/main/resources/plugin.yml | 8 ++++ 11 files changed, 145 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/dictionaries/simon.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/saveactions_settings.xml create mode 100644 .idea/vcs.xml create mode 100644 CliffbreakHub.iml create mode 100644 pom.xml create mode 100644 src/main/java/de/cliffbreak/hub/CliffbreakHub.java create mode 100644 src/main/resources/plugin.yml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..f553981 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dictionaries/simon.xml b/.idea/dictionaries/simon.xml new file mode 100644 index 0000000..e8a0378 --- /dev/null +++ b/.idea/dictionaries/simon.xml @@ -0,0 +1,7 @@ + + + + cliffbreak + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..b26911b --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4b661a5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml new file mode 100644 index 0000000..6025467 --- /dev/null +++ b/.idea/saveactions_settings.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CliffbreakHub.iml b/CliffbreakHub.iml new file mode 100644 index 0000000..78b2cc5 --- /dev/null +++ b/CliffbreakHub.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..cd71521 --- /dev/null +++ b/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + de.cliffbreak.de.hub + CliffbreakHub + 1.0 + + + + org.apache.maven.plugins + maven-compiler-plugin + + 6 + 6 + + + + + + + UTF-8 + + + + + spigotmc-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + + + + org.spigotmc + spigot-api + 1.13-R0.1-SNAPSHOT + provided + + + \ No newline at end of file diff --git a/src/main/java/de/cliffbreak/hub/CliffbreakHub.java b/src/main/java/de/cliffbreak/hub/CliffbreakHub.java new file mode 100644 index 0000000..b50a61f --- /dev/null +++ b/src/main/java/de/cliffbreak/hub/CliffbreakHub.java @@ -0,0 +1,32 @@ +package de.cliffbreak.hub; + +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +public class CliffbreakHub extends JavaPlugin implements CommandExecutor { + @Override + public void onEnable() { + // Enable BungeeCord Messaging System + this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); + + this.getCommand("hub").setExecutor(this); + } + + @Override + public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) { + if (commandSender instanceof Player) { + Player p = (Player) commandSender; + ByteArrayDataOutput out = ByteStreams.newDataOutput(); + out.writeUTF("Connect"); + out.writeUTF("hub"); + p.sendPluginMessage(this, "BungeeCord", out.toByteArray()); + return true; + } + return true; + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..72667a6 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,8 @@ +name: CliffbreakHub +version: 1.0 +main: de.cliffbreak.hub.CliffbreakHub +api-version: 1.14 +commands: + hub: + description: Return to the Hub! + usage: /hub \ No newline at end of file