Delay close of NPC GUI, fixes #2120. Bump version

This commit is contained in:
PikaMug 2023-06-20 23:14:32 -04:00
parent d76082d484
commit d08df181a7
2 changed files with 5 additions and 4 deletions

View File

@ -126,6 +126,7 @@ public class PlayerListener implements Listener {
if (event.getView().getTitle().contains(Lang.get(player, "quests"))) {
final ItemStack clicked = event.getCurrentItem();
if (ItemUtil.isItem(clicked)) {
event.setCancelled(true);
for (final IQuest quest : plugin.getLoadedQuests()) {
final Quest bukkitQuest = (Quest)quest;
if (quest.getGUIDisplay() != null) {
@ -137,12 +138,12 @@ public class PlayerListener implements Listener {
e.printStackTrace();
}
}
event.getWhoClicked().closeInventory();
break;
plugin.getServer().getScheduler().runTaskLater(plugin, () ->
event.getWhoClicked().closeInventory(), 1L);
return;
}
}
}
event.setCancelled(true);
}
}
}

View File

@ -21,7 +21,7 @@
</modules>
<properties>
<revision>4.8.3</revision>
<revision>4.8.4</revision>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>