Browse Source

add support for mc 1.16.2, fix dependency

closes #74
MasterCake 4 years ago
parent
commit
e99b4096f5

+ 10 - 0
Plugin/pom.xml

@@ -151,5 +151,15 @@
 			<artifactId>v1_15_R1</artifactId>
 			<version>1.9.6.12</version>
 		</dependency>
+		<dependency>
+			<groupId>de.Linus122.TimeIsMoney</groupId>
+			<artifactId>v1_16_R1</artifactId>
+			<version>1.9.6.14</version>
+		</dependency>
+		<dependency>
+			<groupId>de.Linus122.TimeIsMoney</groupId>
+			<artifactId>v1_16_R2</artifactId>
+			<version>1.9.6.14</version>
+		</dependency>
 	</dependencies>
 </project>

+ 1 - 0
pom.xml

@@ -31,6 +31,7 @@
         <module>v1_14_R1</module>
         <module>v1_15_R1</module>
         <module>v1_16_R1</module>
+        <module>v1_16_R2</module>
     </modules>
 
     <repositories>

+ 1 - 1
v1_16_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_16_R1/NBTUtils.java

@@ -12,7 +12,7 @@ import static de.Linus122.TimeIsMoney.tools.Utils.CC;
 import java.util.UUID;
 
 /**
- * NBT Utils for v1_15_R1.
+ * NBT Utils for v1_16_R1.
  *
  * @author Linus122
  * @since 1.9.6.11

+ 35 - 0
v1_16_R2/pom.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>de.Linus122.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.14</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_16_R2</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_16_R2</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot</artifactId>
+            <version>1.16.2-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.14</version>
+        </dependency>
+    </dependencies>
+</project>

+ 30 - 0
v1_16_R2/src/main/java/de/Linus122/TimeIsMoney/version/v1_16_R2/NBTUtils.java

@@ -0,0 +1,30 @@
+package de.Linus122.TimeIsMoney.version.v1_16_R2;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import net.minecraft.server.v1_16_R2.ChatMessageType;
+import net.minecraft.server.v1_16_R2.IChatBaseComponent;
+import net.minecraft.server.v1_16_R2.PacketPlayOutChat;
+import org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+import java.util.UUID;
+
+/**
+ * NBT Utils for v1_16_R2.
+ *
+ * @author Linus122
+ * @since 1.9.6.12
+ */
+public class NBTUtils implements ActionBarUtils {
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public void sendActionBarMessage(Player p, String message) {
+		IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message) + "\"}");
+		PacketPlayOutChat bar = new PacketPlayOutChat(icbc, ChatMessageType.GAME_INFO, UUID.randomUUID());
+		((CraftPlayer) p).getHandle().playerConnection.sendPacket(bar);
+	}
+}