2.2.3
This commit is contained in:
parent
1300762753
commit
72c4ac8453
|
@ -1,3 +1,8 @@
|
||||||
|
## 2.2.3
|
||||||
|
- Minor optimizations
|
||||||
|
- Fixed loyalty tridents entering portals despite being disabled in the config
|
||||||
|
- Fixed tridents with loyalty already returning to player at Y=-60
|
||||||
|
|
||||||
## 2.1.1
|
## 2.1.1
|
||||||
- Improved void saving in 1.17+
|
- Improved void saving in 1.17+
|
||||||
|
|
||||||
|
|
17
pom.xml
17
pom.xml
|
@ -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.2.2</version>
|
<version>2.2.3</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<spigot.prefix>${project.name}</spigot.prefix>
|
<spigot.prefix>${project.name}</spigot.prefix>
|
||||||
|
@ -27,19 +27,12 @@
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
<configuration>
|
|
||||||
<finalName>${project.name}</finalName>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.2.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<minimizeJar>true</minimizeJar>
|
||||||
<relocations>
|
<relocations>
|
||||||
<!-- Using the maven-shade-plugin to shade and relocate the UpdateChecker -->
|
<!-- Using the maven-shade-plugin to shade and relocate the UpdateChecker -->
|
||||||
<!-- Replace "your.package" with your plugin's package name -->
|
<!-- Replace "your.package" with your plugin's package name -->
|
||||||
|
@ -56,7 +49,7 @@
|
||||||
<shadedPattern>de.jeff_media.bettertridents.lib.org.codehaus</shadedPattern>
|
<shadedPattern>de.jeff_media.bettertridents.lib.org.codehaus</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>de.jeff_media.jefflib</pattern>
|
<pattern>com.jeff_media.jefflib</pattern>
|
||||||
<shadedPattern>de.jeff_media.bettertridents.jefflib</shadedPattern>
|
<shadedPattern>de.jeff_media.bettertridents.jefflib</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
|
@ -127,9 +120,9 @@
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.jeff_media</groupId>
|
<groupId>com.jeff_media</groupId>
|
||||||
<artifactId>JeffLib</artifactId>
|
<artifactId>JeffLib</artifactId>
|
||||||
<version>7.6.0-SNAPSHOT</version>
|
<version>12.3.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.util.UUID;
|
||||||
public class Main extends JavaPlugin {
|
public class Main extends JavaPlugin {
|
||||||
|
|
||||||
private static Main instance;
|
private static Main instance;
|
||||||
private final ArrayList<UUID> tridents = new ArrayList<>();
|
//private final ArrayList<UUID> tridents = new ArrayList<>();
|
||||||
public static NamespacedKey LOYALTY_TAG;
|
public static NamespacedKey LOYALTY_TAG;
|
||||||
public static NamespacedKey IMPALING_TAG;
|
public static NamespacedKey IMPALING_TAG;
|
||||||
public static NamespacedKey OFFHAND_TAG;
|
public static NamespacedKey OFFHAND_TAG;
|
||||||
|
@ -56,7 +56,7 @@ public class Main extends JavaPlugin {
|
||||||
reloadConfig();
|
reloadConfig();
|
||||||
new Config();
|
new Config();
|
||||||
ConfigUpdater.updateConfig();
|
ConfigUpdater.updateConfig();
|
||||||
UpdateChecker.init(this, "https://api.jeff-media.de/notridentvoid/latest-version.txt")
|
UpdateChecker.init(this, "https://api.jeff-media.com/notridentvoid/latest-version.txt")
|
||||||
.setDonationLink("https://paypal.me/mfnalex")
|
.setDonationLink("https://paypal.me/mfnalex")
|
||||||
.setDownloadLink(92656)
|
.setDownloadLink(92656)
|
||||||
.setChangelogLink(92656)
|
.setChangelogLink(92656)
|
||||||
|
@ -73,11 +73,11 @@ public class Main extends JavaPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoyal(Trident trident) {
|
// public void setLoyal(Trident trident) {
|
||||||
tridents.add(trident.getUniqueId());
|
// tridents.add(trident.getUniqueId());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public void removeLoyal(Trident trident) {
|
// public void removeLoyal(Trident trident) {
|
||||||
tridents.remove(trident.getUniqueId());
|
// tridents.remove(trident.getUniqueId());
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class PortalListener implements Listener {
|
||||||
if(!main.getConfig().getBoolean(Config.DISABLE_LOYALTY_PORTALS)) return;
|
if(!main.getConfig().getBoolean(Config.DISABLE_LOYALTY_PORTALS)) return;
|
||||||
if(event.getEntityType() != EntityType.TRIDENT) return;
|
if(event.getEntityType() != EntityType.TRIDENT) return;
|
||||||
Trident trident = (Trident) event.getEntity();
|
Trident trident = (Trident) event.getEntity();
|
||||||
if(EnchantmentUtils.getLoyalty(trident)) {
|
if(EnchantmentUtils.hasLoyalty(trident)) {
|
||||||
main.debug("Prevented loyalty trident from travelling through portal");
|
main.debug("Prevented loyalty trident from travelling through portal");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,10 +83,10 @@ public class TridentThrowListener implements Listener {
|
||||||
main.debug("Void Saving disabled");
|
main.debug("Void Saving disabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
main.setLoyal(trident);
|
//main.setLoyal(trident);
|
||||||
main.debug("New task: WatchTrident");
|
main.debug("New task: WatchTrident");
|
||||||
new WatchTrident(trident).runTaskTimer(main,1,1);
|
new WatchTrident(trident).runTaskTimer(main,1,1);
|
||||||
Bukkit.getScheduler().runTaskLater(main,() ->main.removeLoyal(trident),1200);
|
//Bukkit.getScheduler().runTaskLater(main,() ->main.removeLoyal(trident),1200);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package de.jeff_media.bettertridents.tasks;
|
package de.jeff_media.bettertridents.tasks;
|
||||||
|
|
||||||
|
import com.jeff_media.jefflib.WorldUtils;
|
||||||
import de.jeff_media.bettertridents.Main;
|
import de.jeff_media.bettertridents.Main;
|
||||||
import de.jeff_media.jefflib.ReflUtils;
|
import com.jeff_media.jefflib.ReflUtils;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Trident;
|
import org.bukkit.entity.Trident;
|
||||||
|
@ -42,7 +43,7 @@ public class WatchTrident extends BukkitRunnable {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
damageDealtField = null;
|
damageDealtField = null;
|
||||||
getHandleMethod = null;
|
getHandleMethod = null;
|
||||||
e.printStackTrace();
|
//e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldCount == 1) {
|
if (fieldCount == 1) {
|
||||||
|
@ -78,7 +79,7 @@ public class WatchTrident extends BukkitRunnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rescue() {
|
private void rescue() {
|
||||||
if (trident.getLocation().getY() >= -60) return;
|
if (trident.getLocation().getY() >= WorldUtils.getWorldMinHeight(trident.getWorld()) - 20) return;
|
||||||
try {
|
try {
|
||||||
damageDealtField.set(getHandleMethod.invoke(trident), true);
|
damageDealtField.set(getHandleMethod.invoke(trident), true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class EnchantmentUtils {
|
||||||
trident.getPersistentDataContainer().set(Main.IMPALING_TAG, PersistentDataType.INTEGER, level);
|
trident.getPersistentDataContainer().set(Main.IMPALING_TAG, PersistentDataType.INTEGER, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getLoyalty(Trident trident) {
|
public static boolean hasLoyalty(Trident trident) {
|
||||||
return trident.getItem().getEnchantments().containsKey(Enchantment.LOYALTY);
|
return trident.getItem().getEnchantments().containsKey(Enchantment.LOYALTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue