From 9df3ba711549ff6bd95dd91cae0cba4b2795be8a Mon Sep 17 00:00:00 2001 From: Vlele <1207223090@qq.com> Date: Fri, 7 Jun 2019 18:19:53 +0800 Subject: [PATCH] Fix:removeDupe make display item wrong Former-commit-id: 205cf9c75455dcfde75658059453061326eb0c43 [formerly 7d187d4fb1b1bde1226713b55f0cdff0c08f701c] Former-commit-id: 4869db92bf069d55a72e321f1ae680473e774f54 --- .../org/maxgamer/quickshop/Shop/ArmorStandDisplayItem.java | 4 ++-- .../java/org/maxgamer/quickshop/Shop/RealDisplayItem.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ArmorStandDisplayItem.java b/src/main/java/org/maxgamer/quickshop/Shop/ArmorStandDisplayItem.java index 5302fd82d..967c0bfd6 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ArmorStandDisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ArmorStandDisplayItem.java @@ -193,12 +193,12 @@ public class ArmorStandDisplayItem implements DisplayItem { } boolean removed = false; Chunk chunk = shop.getLocation().getChunk(); - for (Entity entity : chunk.getEntities()) { + for (Entity entity : armorStand.getNearbyEntities(1, 1, 1)) { if (!(entity instanceof ArmorStand)) { continue; } ArmorStand eArmorStand = (ArmorStand) entity; - if (eArmorStand.getItemInHand().equals(this.guardedIstack)) { + if (plugin.getItemMatcher().matches(eArmorStand.getItemInHand(),this.guardedIstack)) { if (!eArmorStand.getUniqueId().equals(this.armorStand.getUniqueId())) { Util.debugLog("Removing dupes ArmorEntity " + eArmorStand.getUniqueId().toString() + " at " + eArmorStand .getLocation().toString()); diff --git a/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java b/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java index a8d1ef11d..9e465b907 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java @@ -98,7 +98,7 @@ public class RealDisplayItem implements DisplayItem { } boolean removed = false; Chunk chunk = shop.getLocation().getChunk(); - for (Entity entity : chunk.getEntities()) { + for (Entity entity : item.getNearbyEntities(1, 1, 1)) { if (!(entity instanceof Item)) continue; Item eItem = (Item) entity;