From 17ba2879dd1315ba12bd07bc5c375677caed8a32 Mon Sep 17 00:00:00 2001 From: Brianna Date: Wed, 11 Dec 2019 16:43:23 -0500 Subject: [PATCH] Added 1.15 Support. --- pom.xml | 4 ++-- .../songoda/ultimatestacker/listeners/DeathListeners.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 5c7b954..1676509 100644 --- a/pom.xml +++ b/pom.xml @@ -105,8 +105,8 @@ org.spigotmc - spigot-api - 1.14.4-R0.1-SNAPSHOT + spigot + 1.15 provided diff --git a/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java b/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java index 5eb679b..b0be237 100644 --- a/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java +++ b/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java @@ -108,15 +108,15 @@ public class DeathListeners implements Listener { @EventHandler public void onEntityHit(EntityDamageByEntityEvent event) { - if (!(event.getDamager() instanceof Player)) return; + if (!(event.getDamager() instanceof Player) || ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_12)) return; if (!instance.getEntityStackManager().isStacked(event.getEntity())) return; EntityStack stack = instance.getEntityStackManager().getStack(event.getEntity()); if (Settings.KILL_WHOLE_STACK_ON_DEATH.getBoolean() && Settings.REALISTIC_DAMAGE.getBoolean()) { Player player = (Player) event.getDamager(); ItemStack tool = player.getInventory().getItemInHand(); - if (tool.getType().getMaxDurability() < 1 || (tool.getItemMeta() != null && (tool.getItemMeta().spigot().isUnbreakable() - || (ServerProject.isServer(ServerProject.SPIGOT, ServerProject.PAPER) && tool.getItemMeta().spigot().isUnbreakable())))) + if (tool.getType().getMaxDurability() < 1 || (tool.getItemMeta() != null && (tool.getItemMeta().isUnbreakable() + || (ServerProject.isServer(ServerProject.SPIGOT, ServerProject.PAPER) && tool.getItemMeta().isUnbreakable())))) return; int unbreakingLevel = tool.getEnchantmentLevel(Enchantment.DURABILITY);