From b61f0d4232019164646a756dfebadabcd3f8ea5f Mon Sep 17 00:00:00 2001 From: Brianna Date: Wed, 24 Apr 2019 15:11:42 -0400 Subject: [PATCH] Fixed ASync Inventory Open. --- .../songoda/ultimatemoderation/utils/AbstractChatConfirm.java | 3 ++- .../com/songoda/ultimatemoderation/utils/SettingsManager.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/songoda/ultimatemoderation/utils/AbstractChatConfirm.java b/src/main/java/com/songoda/ultimatemoderation/utils/AbstractChatConfirm.java index ad80b38..0506eab 100644 --- a/src/main/java/com/songoda/ultimatemoderation/utils/AbstractChatConfirm.java +++ b/src/main/java/com/songoda/ultimatemoderation/utils/AbstractChatConfirm.java @@ -49,7 +49,8 @@ public class AbstractChatConfirm implements Listener { handler.onChat(chatConfirmEvent); if (onClose != null) { - onClose.onClose(); + Bukkit.getScheduler().scheduleSyncDelayedTask(UltimateModeration.getInstance(), () -> + onClose.onClose(), 0L); } HandlerList.unregisterAll(listener); } diff --git a/src/main/java/com/songoda/ultimatemoderation/utils/SettingsManager.java b/src/main/java/com/songoda/ultimatemoderation/utils/SettingsManager.java index 3453b75..9481b4a 100644 --- a/src/main/java/com/songoda/ultimatemoderation/utils/SettingsManager.java +++ b/src/main/java/com/songoda/ultimatemoderation/utils/SettingsManager.java @@ -82,7 +82,9 @@ public class SettingsManager implements Listener { config.set(value, event.getMessage()); } - this.finishEditing(player); + Bukkit.getScheduler().scheduleSyncDelayedTask(UltimateModeration.getInstance(), () -> + this.finishEditing(player), 0L); + event.setCancelled(true); }