Optimize the targetShopDisplayCheck performance

Former-commit-id: 539c1d93571be609bc40d731f4cc5ceaef323992 [formerly 7f4f5d49a0600480a96eb52c07685cac25f24e3a]
Former-commit-id: 7aa7cd5b5837e5785d5599692c454ef66360fe0d
This commit is contained in:
Ghost_chu committed 2019-08-26 16:04:55 +08:00
1 parent b375f3c7d3
commit c8e792ee7b
1 file changed
+4 -1
@@ -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())) {