Close Inventory when server shutting down

Former-commit-id: 4ce43a6f96406a9b5dbe1dc50a1dbd9dd358cf35 [formerly 39a0d86d9e6f77032c2d047416f368c5ba44b16d]
Former-commit-id: 303e42588bb61c80a2725a47925140145063969a
This commit is contained in:
Ghost_chu committed 2019-05-10 19:25:23 +08:00
1 parent 61566e91fa
commit 514cb17f70
2 files changed
+5

No files matched your search

@@ -903,6 +903,9 @@ public class QuickShop extends JavaPlugin {
public void onDisable() {
if (noopDisable)
return;
for (Player player : Bukkit.getOnlinePlayers()) {
player.closeInventory();
}
if (itemWatcherTask != null) {
itemWatcherTask.cancel();
}
@@ -63,6 +63,8 @@ public class InventoryPreview implements Listener {
}
public static boolean isPreviewItem(ItemStack stack) {
if(!stack.hasItemMeta()||!stack.getItemMeta().hasLore())
return false;
List<String> lores = stack.getItemMeta().getLore();
for (String string : lores) {
if(string.equals("QuickShop GUI preview item")) {