From 3ffd3f33589a3a4e564bd773afe011cbd9a87106 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Mon, 8 Feb 2021 10:59:29 +0800 Subject: [PATCH] clean up --- src/main/java/org/maxgamer/quickshop/shop/ContainerShop.java | 5 ++--- .../java/org/maxgamer/quickshop/shop/RealDisplayItem.java | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/shop/ContainerShop.java b/src/main/java/org/maxgamer/quickshop/shop/ContainerShop.java index dd3397e20..2ffc342c6 100644 --- a/src/main/java/org/maxgamer/quickshop/shop/ContainerShop.java +++ b/src/main/java/org/maxgamer/quickshop/shop/ContainerShop.java @@ -702,8 +702,7 @@ public class ContainerShop implements Shop { try { plugin.getDatabaseHelper().updateShop(ShopModerator.serialize(this.moderator.clone()), this.getItem(), unlimited, shopType.toID(), this.getPrice(), x, y, z, world, this.saveExtraToJson()); } catch (Exception e) { - e.printStackTrace(); - plugin.getLogger().log(Level.WARNING, "Could not update a shop in the database! Changes will revert after a reboot!"); + plugin.getLogger().log(Level.WARNING, "Could not update a shop in the database! Changes will revert after a reboot!", e); } } @@ -1173,7 +1172,7 @@ public class ContainerShop implements Shop { if (this.item.hasItemMeta() && this.item.getItemMeta().hasEnchants()) { return Objects.requireNonNull(this.item.getItemMeta()).getEnchants(); } - return new HashMap<>(); + return Collections.emptyMap(); } /** diff --git a/src/main/java/org/maxgamer/quickshop/shop/RealDisplayItem.java b/src/main/java/org/maxgamer/quickshop/shop/RealDisplayItem.java index 959fc57e7..ea9879a74 100644 --- a/src/main/java/org/maxgamer/quickshop/shop/RealDisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/shop/RealDisplayItem.java @@ -245,7 +245,6 @@ public class RealDisplayItem extends DisplayItem { @Override public boolean isSpawned() { - Util.ensureThread(false); if (this.item == null) { return false; }