Update for 1.10

This commit is contained in:
Jakub Kolář 2016-06-12 19:55:56 +02:00
parent 01c0ac0ac4
commit b6f2d665bd
6 changed files with 96 additions and 5 deletions

View File

@ -56,6 +56,12 @@
<version>${boosCooldowns.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cz.boosik</groupId>
<artifactId>NMS_hook_1_10_R1</artifactId>
<version>${boosCooldowns.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -32,13 +32,15 @@ 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();
hook = new NMSHook_v1_10_R1();
} else if (version.equals("v1_8_R3")) {
hook = new NMSHook_v1_8_R3();
} else if (version.equals("v1_8_R2")) {
hook = new NMSHook_v1_8_R2();
} else if (version.equals("v1_8_R1")) {
hook = new NMSHook_v1_8_R1();
} else if (version.equals("v1_10_R1")) {
hook = new NMSHook_v1_10_R1();
}
compatible = hook != null;

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>boosCooldowns</artifactId>
<groupId>cz.boosik</groupId>
<version>${boosCooldowns.version}</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>NMS_hook_1_10_R1</artifactId>
<dependencies>
<!--Spigot API-->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -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);
}

View File

@ -0,0 +1,29 @@
package nms;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_10_R1.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
/**
* All rights reserved.
*
* @author ColoredCarrot
*/
public class NMSHook_v1_10_R1
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));
}
}

View File

@ -10,19 +10,20 @@
<module>nms/NMS_hook_1_8_R3</module>
<module>nms/NMS_hook_1_9_R1</module>
<module>nms/NMS_hook_1_9_R2</module>
<module>nms/NMS_hook_1_10_R1</module>
<module>nms/NMS</module>
<module>plugin</module>
<module>jar</module>
</modules>
</modules>
<packaging>pom</packaging>
<url>http://maven.apache.org</url>
<properties>
<boosCooldowns.version>3.11.1</boosCooldowns.version>
<boosCooldowns.version>3.11.2</boosCooldowns.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<minecraft.version>1.9.2</minecraft.version>
<minecraft.version>1.10</minecraft.version>
<bukkit.version>R0.1</bukkit.version>
<bukkit.packet>v1_9_R1</bukkit.packet>
<bukkit.packet>v1_10_R1</bukkit.packet>
</properties>
<pluginRepositories>
<pluginRepository>