Update dependencies and fix tellRaw for 1.17+

This commit is contained in:
Norbi Peti 2021-12-30 21:18:48 +01:00
parent 56b9296fbb
commit 6c1378f370
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
3 changed files with 41 additions and 35 deletions

66
pom.xml
View file

@ -95,22 +95,26 @@
</repository> </repository>
<repository> <repository>
<id>ess-repo</id> <id>ess-repo</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url> <url>https://repo.essentialsx.net/releases/</url>
</repository> </repository>
<!-- <repository> <!-- <repository>
<id>Minigames</id> <id>Minigames</id>
<url>http://maven.addstar.com.au/artifactory/release</url> <url>http://maven.addstar.com.au/artifactory/release</url>
</repository> --> </repository> -->
<!-- <repository> <!-- <repository>
<id>vault-repo</id> <id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url> <url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository> --> </repository> -->
<!-- <repository> <id>WorldEdit</id> <url>http://maven.sk89q.com/artifactory/repo</url> <!-- <repository> <id>WorldEdit</id> <url>http://maven.sk89q.com/artifactory/repo</url>
</repository> --> </repository> -->
<repository> <repository>
<id>projectlombok.org</id> <id>projectlombok.org</id>
<url>http://projectlombok.org/mavenrepo</url> <url>https://projectlombok.org/mavenrepo</url>
</repository> </repository>
<repository>
<id>Dynmap</id>
<url>https://repo.mikeprimm.com</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency> <dependency>
@ -124,9 +128,9 @@
<version>v1.0.0</version> <version>v1.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.ess3</groupId> <groupId>net.essentialsx</groupId>
<artifactId>EssentialsX</artifactId> <artifactId>EssentialsX</artifactId>
<version>2.17.1</version> <version>2.19.2</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -136,19 +140,19 @@
<version>0.96.2.0</version> <version>0.96.2.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- <dependency> <groupId>au.com.mineauz</groupId> <artifactId>Minigames</artifactId> <!-- <dependency> <groupId>au.com.mineauz</groupId> <artifactId>Minigames</artifactId>
<version>1.8.0</version> </dependency> --> <version>1.8.0</version> </dependency> -->
<dependency> <dependency>
<groupId>com.github.milkbowl</groupId> <groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId> <artifactId>VaultAPI</artifactId>
<version>master-SNAPSHOT</version> <version>1.7</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.18.10</version> <version>1.18.22</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -164,20 +168,20 @@
<version>1.16.4-R0.1-SNAPSHOT</version> <version>1.16.4-R0.1-SNAPSHOT</version>
</dependency> --> </dependency> -->
<dependency> <dependency>
<groupId>com.github.webbukkit</groupId> <groupId>com.github.TownyAdvanced</groupId>
<artifactId>Dynmap-Towny</artifactId> <artifactId>Dynmap-Towny</artifactId>
<version>master-SNAPSHOT</version> <version>0.89</version>
</dependency>
<dependency>
<groupId>com.github.webbukkit</groupId>
<artifactId>Dynmap</artifactId>
<version>v2.5</version>
</dependency> </dependency>
<dependency>
<groupId>us.dynmap</groupId>
<artifactId>dynmap-api</artifactId>
<version>3.2-beta-1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit --> <!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.13.1</version> <version>4.13.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Included in vanilla minecraft's JAR --> <!-- Included in vanilla minecraft's JAR -->
@ -191,7 +195,7 @@
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId> <artifactId>mockito-core</artifactId>
<version>3.0.0</version> <version>4.2.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View file

@ -82,8 +82,10 @@ public class VanillaUtils {
if (notCraftPlayer(pcl)) return false; if (notCraftPlayer(pcl)) return false;
val hm = pcl.getMethod("getHandle"); val hm = pcl.getMethod("getHandle");
val handle = hm.invoke(p); val handle = hm.invoke(p);
val nms = handle.getClass().getPackage().getName(); var nmsOrChat = handle.getClass().getPackage().getName();
val chatcompcl = Class.forName(nms + ".IChatBaseComponent"); if (!nmsOrChat.contains(".v1_"))
nmsOrChat = "net.minecraft.network.chat";
val chatcompcl = Class.forName(nmsOrChat + ".IChatBaseComponent");
//val chatcomarrcl = Class.forName("[L" + chatcompcl.getName() + ";"); //val chatcomarrcl = Class.forName("[L" + chatcompcl.getName() + ";");
val chatcomparr = Array.newInstance(chatcompcl, 1); val chatcomparr = Array.newInstance(chatcompcl, 1);
final Method sendmsg; final Method sendmsg;

View file

@ -4,7 +4,7 @@ import lombok.val;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.dynmap.bukkit.DynmapPlugin; import org.dynmap.DynmapCommonAPI;
import org.dynmap.markers.MarkerAPI; import org.dynmap.markers.MarkerAPI;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
@ -35,7 +35,7 @@ public class DTBridge {
Constructor<?> c = cl.getDeclaredConstructor(FileConfiguration.class, String.class, MarkerAPI.class); Constructor<?> c = cl.getDeclaredConstructor(FileConfiguration.class, String.class, MarkerAPI.class);
c.setAccessible(true); c.setAccessible(true);
style = c.newInstance(dtp.getConfig(), "custstyle." + townname, style = c.newInstance(dtp.getConfig(), "custstyle." + townname,
((DynmapPlugin) Bukkit.getPluginManager().getPlugin("dynmap")).getMarkerAPI()); ((DynmapCommonAPI) Bukkit.getPluginManager().getPlugin("dynmap")).getMarkerAPI());
map.put(townname, style); map.put(townname, style);
} }
set(cl, style, "fillcolor", fillcolor); set(cl, style, "fillcolor", fillcolor);