Skip to content

Commit

Permalink
fix: fire FrameOpenEvent sync
Browse files Browse the repository at this point in the history
  • Loading branch information
RoinujNosde committed Apr 25, 2024
1 parent 8cd0b2e commit 67d3e70
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public static void open(@Nullable SCFrame frame) {
return;
}

OPENING.put(uuid, frame);
FrameOpenEvent event = new FrameOpenEvent(frame.getViewer(), frame);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
OPENING.put(uuid, frame);
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
FrameOpenEvent event = new FrameOpenEvent(frame.getViewer(), frame);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
Inventory inventory = prepareInventory(frame);

if (!frame.equals(OPENING.get(uuid))) {
Expand Down

0 comments on commit 67d3e70

Please sign in to comment.