Added 1.15 Support.

This commit is contained in:
Brianna 2019-12-11 16:43:23 -05:00
parent e445d816eb
commit 17ba2879dd
2 changed files with 5 additions and 5 deletions

View File

@ -105,8 +105,8 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version> <version>1.15</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -108,15 +108,15 @@ public class DeathListeners implements Listener {
@EventHandler @EventHandler
public void onEntityHit(EntityDamageByEntityEvent event) { 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; if (!instance.getEntityStackManager().isStacked(event.getEntity())) return;
EntityStack stack = instance.getEntityStackManager().getStack(event.getEntity()); EntityStack stack = instance.getEntityStackManager().getStack(event.getEntity());
if (Settings.KILL_WHOLE_STACK_ON_DEATH.getBoolean() && Settings.REALISTIC_DAMAGE.getBoolean()) { if (Settings.KILL_WHOLE_STACK_ON_DEATH.getBoolean() && Settings.REALISTIC_DAMAGE.getBoolean()) {
Player player = (Player) event.getDamager(); Player player = (Player) event.getDamager();
ItemStack tool = player.getInventory().getItemInHand(); ItemStack tool = player.getInventory().getItemInHand();
if (tool.getType().getMaxDurability() < 1 || (tool.getItemMeta() != null && (tool.getItemMeta().spigot().isUnbreakable() if (tool.getType().getMaxDurability() < 1 || (tool.getItemMeta() != null && (tool.getItemMeta().isUnbreakable()
|| (ServerProject.isServer(ServerProject.SPIGOT, ServerProject.PAPER) && tool.getItemMeta().spigot().isUnbreakable())))) || (ServerProject.isServer(ServerProject.SPIGOT, ServerProject.PAPER) && tool.getItemMeta().isUnbreakable()))))
return; return;
int unbreakingLevel = tool.getEnchantmentLevel(Enchantment.DURABILITY); int unbreakingLevel = tool.getEnchantmentLevel(Enchantment.DURABILITY);