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

32
pom.xml
View file

@ -95,7 +95,7 @@
</repository>
<repository>
<id>ess-repo</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url>
<url>https://repo.essentialsx.net/releases/</url>
</repository>
<!-- <repository>
<id>Minigames</id>
@ -109,7 +109,11 @@
</repository> -->
<repository>
<id>projectlombok.org</id>
<url>http://projectlombok.org/mavenrepo</url>
<url>https://projectlombok.org/mavenrepo</url>
</repository>
<repository>
<id>Dynmap</id>
<url>https://repo.mikeprimm.com</url>
</repository>
</repositories>
<dependencies>
@ -124,9 +128,9 @@
<version>v1.0.0</version>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<groupId>net.essentialsx</groupId>
<artifactId>EssentialsX</artifactId>
<version>2.17.1</version>
<version>2.19.2</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -139,16 +143,16 @@
<!-- <dependency> <groupId>au.com.mineauz</groupId> <artifactId>Minigames</artifactId>
<version>1.8.0</version> </dependency> -->
<dependency>
<groupId>com.github.milkbowl</groupId>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>master-SNAPSHOT</version>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
@ -164,20 +168,20 @@
<version>1.16.4-R0.1-SNAPSHOT</version>
</dependency> -->
<dependency>
<groupId>com.github.webbukkit</groupId>
<groupId>com.github.TownyAdvanced</groupId>
<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>
<groupId>us.dynmap</groupId>
<artifactId>dynmap-api</artifactId>
<version>3.2-beta-1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<!-- Included in vanilla minecraft's JAR -->
@ -191,7 +195,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>

View file

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

View file

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