Optimize logic for inventory check to prevent broke the plugin gui

Former-commit-id: b928c002bd8086a8ce33d98511678dc28335a336
This commit is contained in:
Ghost_chu committed 2020-01-03 19:12:09 +08:00
1 parent 5f5b6b4b75
commit 6803336b4e
1 file changed
+5 -1
@@ -645,6 +645,10 @@ public class Util {
if (inv == null) {
return;
}
if(inv.getHolder() == null){
Util.debugLog("Skipped plugin gui inventory check.");
return;
}
new BukkitRunnable() {
@Override
public void run() {
@@ -661,7 +665,7 @@ public class Util {
return; //Virtual GUI
}
plugin.getSyncTaskWatcher().getInventoryEditQueue()
.offer(new InventoryEditContainer(inv, i, new ItemStack(Material.AIR, 0)));
.offer(new InventoryEditContainer(inv, i, new ItemStack(Material.AIR)));
Util.debugLog("Found a displayitem in an inventory, Scheduling to removeal...");
MsgUtil.sendGlobalAlert("[InventoryCheck] Found displayItem in inventory at " + location + ", Item is " + itemStack
.getType().name());