Skip to content

Commit

Permalink
Fixed the bug that occurred whenever you pressed the recipe book.
Browse files Browse the repository at this point in the history
  • Loading branch information
its-c10 committed Feb 11, 2022
1 parent 8dd46dd commit f54e7b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/dohaw/ironcraft/IronCraftPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public void onPacketReceiving(PacketEvent event) {
// If they try to complete the objective and clicking the recipe menu button while it's open, it'll close it and that'll leave them confused.
if (isRecipeMenuOpen) {
playerData.setCurrentTutorialObjective(getNextObjective(Objective.OPEN_RECIPE_MENU));
Bukkit.getServer().getPluginManager().callEvent(new CompleteObjectiveEvent(playerData));
Bukkit.getScheduler().runTask(instance, () -> {
Bukkit.getServer().getPluginManager().callEvent(new CompleteObjectiveEvent(playerData));
});
} else {
player.sendMessage(ChatColor.RED + "Oops! Looks like you just closed it. Try opening the recipe menu again...");
}
Expand Down

0 comments on commit f54e7b9

Please sign in to comment.