diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java index 20470dd7f..a9fe9f23c 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java @@ -10,7 +10,6 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.ChunkUnloadEvent; -import org.bukkit.scheduler.BukkitRunnable; import org.maxgamer.quickshop.QuickShop; import org.maxgamer.quickshop.Shop.Shop; @@ -26,16 +25,16 @@ public class ChunkListener implements Listener { HashMap inChunk = plugin.getShopManager().getShops(c); if (inChunk == null || inChunk.isEmpty()) return; - new BukkitRunnable() { - - @Override - public void run() { - for (Shop shop : inChunk.values()) { - shop.onLoad(); - } - - } - }.runTaskLater(plugin, 1); //Delay 1 tick, hope can fix the magic bug in 1.14 spigot build. + // new BukkitRunnable() { + // + // @Override + // public void run() { + for (Shop shop : inChunk.values()) { + shop.onLoad(); + } + // + // } + // }.runTaskLater(plugin, 1); //Delay 1 tick, hope can fix the magic bug in 1.14 spigot build. } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @@ -44,13 +43,13 @@ public class ChunkListener implements Listener { HashMap inChunk = plugin.getShopManager().getShops(c); if (inChunk == null || inChunk.isEmpty()) return; - new BukkitRunnable() { - @Override - public void run() { - for (Shop shop : inChunk.values()) { - shop.onUnload(); - } - } - }.runTaskLater(plugin, 1); //Delay 1 tick, hope can fix the magic bug in 1.14 spigot build. + // new BukkitRunnable() { + // @Override + // public void run() { + for (Shop shop : inChunk.values()) { + shop.onUnload(); + } + // } + // }.runTaskLater(plugin, 1); //Delay 1 tick, hope can fix the magic bug in 1.14 spigot build. } } \ No newline at end of file diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java index 38b9b205e..9eab88f52 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java @@ -733,10 +733,10 @@ public class ContainerShop implements Shop { return; } - if (!Util.isLoaded(this.getLocation())) { - Util.debugLog("Shop " + this.getLocation().toString() + " skipped to load: Target location not loaded."); - return; - } + // if (!Util.isLoaded(this.getLocation())) { + // Util.debugLog("Shop " + this.getLocation().toString() + " skipped to load: Target location not loaded."); + // return; + // } if (!Util.canBeShop(this.getLocation().getBlock())) { this.onUnload(); diff --git a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java index 9f98dd080..a62888281 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java @@ -142,6 +142,10 @@ public interface DisplayItem { for (String lore : lores) { try { ShopProtectionFlag shopProtectionFlag = gson.fromJson(lore, ShopProtectionFlag.class); + if (shopProtectionFlag == null) + continue; + if (shopProtectionFlag.getMark() == null) + continue; if (shopProtectionFlag.getMark().equals("QuickShop DisplayItem")) return true; } catch (JsonSyntaxException e) { @@ -170,6 +174,10 @@ public interface DisplayItem { for (String lore : lores) { try { ShopProtectionFlag shopProtectionFlag = gson.fromJson(lore, ShopProtectionFlag.class); + if (shopProtectionFlag == null) + continue; + if (shopProtectionFlag.getMark() == null) + continue; if (shopProtectionFlag.getShopLocation().equals(shop.getLocation().toString())) return true; } catch (JsonSyntaxException e) {