From c8e792ee7bf7c1410d600fa44dba2b227cd4b39b Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Mon, 26 Aug 2019 16:04:55 +0800 Subject: [PATCH] Optimize the targetShopDisplayCheck performance Former-commit-id: 539c1d93571be609bc40d731f4cc5ceaef323992 [formerly 7f4f5d49a0600480a96eb52c07685cac25f24e3a] Former-commit-id: 7aa7cd5b5837e5785d5599692c454ef66360fe0d --- src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java index cc7567916..6e6ba3092 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java @@ -95,11 +95,14 @@ public interface DisplayItem { Gson gson = new Gson(); for (String lore : lores) { try { + if (!lore.startsWith("{")) { + continue; + } ShopProtectionFlag shopProtectionFlag = gson.fromJson(lore, ShopProtectionFlag.class); if (shopProtectionFlag == null) { continue; } - if (shopProtectionFlag.getMark() == null) { + if (!shopProtectionFlag.getMark().equals(ShopProtectionFlag.getDefaultMark())) { continue; } if (shopProtectionFlag.getShopLocation().equals(shop.getLocation().toString())) {