Skip to content

Commit

Permalink
Directly move from the ItemCreator to the Recipe ItemEditor when canc…
Browse files Browse the repository at this point in the history
…elling
  • Loading branch information
WolfyScript committed Mar 15, 2024
1 parent 1ec37ad commit 7251fda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public void onInit() {
})).register();
btnB.action(CANCEL).state(s -> s.icon(Material.BARRIER).action((cache, guiHandler, player, inventory, i, event) -> {
cache.getItems().editorWasPreviouslyCancelled(true);
if (cache.getItems().isRecipeItem()) { // Directly jump to the ItemEditor of the RecipeCreator, to not show the pickup window
guiHandler.openCluster("recipe_creator");
}
return true;
})).register();
btnB.itemInput(ITEM_INPUT).state(s -> s.icon(Material.AIR).postAction((cache, guiHandler, player, guiInventory, stack, slot, event) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void onInit() {
return true;
})).register();
getButtonBuilder().action("create_item").state(s -> s.icon(Material.ITEM_FRAME).action((cache, guiHandler, player, guiInventory, i, inventoryInteractEvent) -> {
cache.getItems().editorWasPreviouslyCancelled(false);
guiHandler.openWindow(ClusterItemCreator.MAIN_MENU);
return true;
})).register();
Expand Down

0 comments on commit 7251fda

Please sign in to comment.