From cfddb0ca1ec32b17ac53f0e216f95a642d5b2f49 Mon Sep 17 00:00:00 2001 From: PikaMug Date: Fri, 26 Jul 2019 15:53:44 -0400 Subject: [PATCH] Improve item type comparison for MC 1.8, fixes #865 --- .../me/blackvein/quests/util/ItemUtil.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/util/ItemUtil.java b/main/src/main/java/me/blackvein/quests/util/ItemUtil.java index 4b51437a0..e58087f82 100644 --- a/main/src/main/java/me/blackvein/quests/util/ItemUtil.java +++ b/main/src/main/java/me/blackvein/quests/util/ItemUtil.java @@ -125,14 +125,16 @@ public class ItemUtil { } } if (Material.getMaterial("LINGERING_POTION") == null) { - // Bukkit version is below 1.9 - Potion pot1 = new Potion(one.getDurability()); - Potion pot2 = new Potion(two.getDurability()); - if (pot1.getType() == null || pot2.getType() == null) { - return -9; - } - if (!pot1.getType().equals(pot2.getType())) { - return -9; + if (one.getType().equals(Material.POTION)) { + // Bukkit version is below 1.9 + Potion pot1 = new Potion(one.getDurability()); + Potion pot2 = new Potion(two.getDurability()); + if (pot1.getType() == null || pot2.getType() == null) { + return -9; + } + if (!pot1.getType().equals(pot2.getType())) { + return -9; + } } } if (one.getEnchantments().equals(two.getEnchantments()) == false) {