From 01c0ac0ac4836431adfe807f55eafa7988e17616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kol=C3=A1=C5=99?= Date: Mon, 16 May 2016 15:05:25 +0200 Subject: [PATCH] Update for 1.9.4 --- jar/pom.xml | 28 +++++++++++------- nms/NMS/pom.xml | 24 +++++++++------ nms/NMS/src/main/java/nms/NMS.java | 2 ++ nms/NMS_hook_1_9_R2/pom.xml | 25 ++++++++++++++++ .../src/main/java/nms/NMSHook.java | 28 ++++++++++++++++++ .../src/main/java/nms/NMSHook_v1_9_R2.java | 29 +++++++++++++++++++ plugin/src/main/resources/plugin.yml | 2 +- pom.xml | 3 +- 8 files changed, 119 insertions(+), 22 deletions(-) create mode 100644 nms/NMS_hook_1_9_R2/pom.xml create mode 100644 nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook.java create mode 100644 nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook_v1_9_R2.java diff --git a/jar/pom.xml b/jar/pom.xml index 9e1775b..5361f1a 100644 --- a/jar/pom.xml +++ b/jar/pom.xml @@ -16,37 +16,43 @@ cz.boosik NMS - 3.11.0 + ${boosCooldowns.version} compile cz.boosik NMS_hook_1_8_R3 - 3.11.0 - compile - - - cz.boosik - NMS_hook_1_9_R1 - 3.11.0 + ${boosCooldowns.version} compile cz.boosik NMS_hook_1_8_R1 - 3.11.0 + ${boosCooldowns.version} compile cz.boosik NMS_hook_1_8_R2 - 3.11.0 + ${boosCooldowns.version} + compile + + + cz.boosik + NMS_hook_1_9_R1 + ${boosCooldowns.version} + compile + + + cz.boosik + NMS_hook_1_9_R2 + ${boosCooldowns.version} compile cz.boosik plugin - 3.11.0 + ${boosCooldowns.version} compile diff --git a/nms/NMS/pom.xml b/nms/NMS/pom.xml index bc36441..870077a 100644 --- a/nms/NMS/pom.xml +++ b/nms/NMS/pom.xml @@ -29,25 +29,31 @@ cz.boosik NMS_hook_1_8_R3 - 3.11.0 - compile - - - cz.boosik - NMS_hook_1_9_R1 - 3.11.0 + ${boosCooldowns.version} compile cz.boosik NMS_hook_1_8_R1 - 3.11.0 + ${boosCooldowns.version} compile cz.boosik NMS_hook_1_8_R2 - 3.11.0 + ${boosCooldowns.version} + compile + + + cz.boosik + NMS_hook_1_9_R1 + ${boosCooldowns.version} + compile + + + cz.boosik + NMS_hook_1_9_R2 + ${boosCooldowns.version} compile diff --git a/nms/NMS/src/main/java/nms/NMS.java b/nms/NMS/src/main/java/nms/NMS.java index 13bca60..bcacf47 100644 --- a/nms/NMS/src/main/java/nms/NMS.java +++ b/nms/NMS/src/main/java/nms/NMS.java @@ -31,6 +31,8 @@ public class NMS { if (version.equals("v1_9_R1")) { hook = new NMSHook_v1_9_R1(); + } else if (version.equals("v1_9_R2")) { + hook = new NMSHook_v1_9_R2(); } else if (version.equals("v1_8_R3")) { hook = new NMSHook_v1_8_R3(); } else if (version.equals("v1_8_R2")) { diff --git a/nms/NMS_hook_1_9_R2/pom.xml b/nms/NMS_hook_1_9_R2/pom.xml new file mode 100644 index 0000000..9649db9 --- /dev/null +++ b/nms/NMS_hook_1_9_R2/pom.xml @@ -0,0 +1,25 @@ + + + + boosCooldowns + cz.boosik + ../../pom.xml + ${boosCooldowns.version} + + 4.0.0 + + NMS_hook_1_9_R2 + + + + + org.spigotmc + spigot + 1.9.4-R0.1-SNAPSHOT + provided + + + + \ No newline at end of file diff --git a/nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook.java b/nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook.java new file mode 100644 index 0000000..3b99b16 --- /dev/null +++ b/nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook.java @@ -0,0 +1,28 @@ +package nms; + +import org.bukkit.entity.Player; + +/** + * All rights reserved. + * + * @author ColoredCarrot + */ +public interface NMSHook { + + /** + * Sends a JSON message to a player. + * + * @param json (String) - the plain JSON + * @param player (Player) - the player + */ + public void sendJSON(String json, Player player); + + /** + * Sends an actionbar to a player. + * + * @param json (String) - the plain JSON + * @param player (Player) - the player + */ + public void sendActionBar(String json, Player player); + +} diff --git a/nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook_v1_9_R2.java b/nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook_v1_9_R2.java new file mode 100644 index 0000000..0421a9a --- /dev/null +++ b/nms/NMS_hook_1_9_R2/src/main/java/nms/NMSHook_v1_9_R2.java @@ -0,0 +1,29 @@ +package nms; + +import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer; +import org.bukkit.entity.Player; + +import net.minecraft.server.v1_9_R2.IChatBaseComponent.ChatSerializer; +import net.minecraft.server.v1_9_R2.PacketPlayOutChat; + +/** + * All rights reserved. + * + * @author ColoredCarrot + */ +public class NMSHook_v1_9_R2 + implements NMSHook { + + public void sendJSON(String json, Player player) { + + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutChat(ChatSerializer.a(json))); + + } + + public void sendActionBar(String json, Player player) { + + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutChat(ChatSerializer.a(json), (byte) 2)); + + } + +} diff --git a/plugin/src/main/resources/plugin.yml b/plugin/src/main/resources/plugin.yml index 6973ef6..aaf3f10 100644 --- a/plugin/src/main/resources/plugin.yml +++ b/plugin/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: boosCooldowns main: cz.boosik.boosCooldown.BoosCoolDown -version: 3.11.0 +version: 3.11.1 authors: [LordBoos (boosik)] softdepend: [Vault] description: > diff --git a/pom.xml b/pom.xml index b833242..5143ed5 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,7 @@ nms/NMS_hook_1_8_R2 nms/NMS_hook_1_8_R3 nms/NMS_hook_1_9_R1 + nms/NMS_hook_1_9_R2 nms/NMS plugin jar @@ -16,7 +17,7 @@ pom http://maven.apache.org - 3.11.0 + 3.11.1 UTF-8 UTF-8 1.9.2