2.1.1 release

This commit is contained in:
mfnalex 2021-06-13 20:18:30 +02:00
parent 45c7d63b0a
commit 1fe40e2ffa
3 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,6 @@
## 2.1.1
- Improved void saving in 1.17+
## 2.1.0 ## 2.1.0
- Tridents will not be instantly returned when hitting Y=0 - Tridents will not be instantly returned when hitting Y=0
- Fixed players without "bettertridents.savevoid" permissions being able to use the "void-saving" feature anyway - Fixed players without "bettertridents.savevoid" permissions being able to use the "void-saving" feature anyway

View File

@ -6,7 +6,7 @@
<groupId>de.jeff_media</groupId> <groupId>de.jeff_media</groupId>
<name>BetterTridents</name> <name>BetterTridents</name>
<artifactId>BetterTridents</artifactId> <artifactId>BetterTridents</artifactId>
<version>2.1.0</version> <version>2.1.1</version>
<properties> <properties>
<spigot.prefix>${project.name}</spigot.prefix> <spigot.prefix>${project.name}</spigot.prefix>
@ -135,7 +135,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version> <version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -19,8 +19,18 @@ public class WatchTrident extends BukkitRunnable {
static { static {
int fieldCount = 0; int fieldCount = 0;
Class<?> entityThrownTridentClass = null;
try { try {
final Class<?> entityThrownTridentClass = ReflUtil.getNMSClass("EntityThrownTrident"); entityThrownTridentClass = ReflUtil.getNMSClass("EntityThrownTrident");
} catch (Throwable ignored) {
// 1.17+
}
try {
if(entityThrownTridentClass == null) {
// 1.17+
entityThrownTridentClass = Class.forName("net.minecraft.world.entity.projectile.EntityThrownTrident");
}
getHandleMethod = ReflUtil.getOBCClass("entity.CraftTrident").getMethod("getHandle"); getHandleMethod = ReflUtil.getOBCClass("entity.CraftTrident").getMethod("getHandle");
for (Field field : entityThrownTridentClass.getDeclaredFields()) { for (Field field : entityThrownTridentClass.getDeclaredFields()) {
if (field.getType() == Boolean.TYPE) { if (field.getType() == Boolean.TYPE) {
@ -32,6 +42,7 @@ public class WatchTrident extends BukkitRunnable {
} catch (Exception e) { } catch (Exception e) {
damageDealtField = null; damageDealtField = null;
getHandleMethod = null; getHandleMethod = null;
e.printStackTrace();
} }
if (fieldCount == 1) { if (fieldCount == 1) {