From 642e6fe40528a7823b1a702fe520d56361b5b7fa Mon Sep 17 00:00:00 2001 From: sandtechnology Date: Mon, 30 Aug 2021 21:41:48 +0800 Subject: [PATCH] Fix for cannot tick distance manager while unloading playerchunks --- .../org/maxgamer/quickshop/listener/PlayerListener.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/listener/PlayerListener.java b/src/main/java/org/maxgamer/quickshop/listener/PlayerListener.java index d48b3bfe5..c8b76769d 100644 --- a/src/main/java/org/maxgamer/quickshop/listener/PlayerListener.java +++ b/src/main/java/org/maxgamer/quickshop/listener/PlayerListener.java @@ -300,14 +300,15 @@ public class PlayerListener extends QSListener { if (e.getInventory() == null) { return; } - if (e.getInventory().getLocation() == null) { - return; - } location = e.getInventory().getLocation(); - if (location == null) { return; /// ignored as workaround, GH-303 } + //Cannot tick distance manager while unloading playerchunks + //https://github.com/pl3xgaming/Purpur/issues/631 + if (!Util.isLoaded(location)) { + return; + } final Shop shop = plugin.getShopManager().getShopIncludeAttached(location); if (shop != null) { shop.setSignText();