Skip to content

Commit edaeb09

Browse files
committed
Fire advancement triggers when crafting via the QIO crafting windows. Fixes being unable to earn careful restoration via QIO crafting windows
1 parent 0e4e938 commit edaeb09

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/main/java/mekanism/common/content/qio/QIOCraftingWindow.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,17 @@ private boolean validateAndUnlockRecipe(@Nullable Level world, @NotNull Player p
220220
//Note: lastRecipe shouldn't be null here, but we validate it just in case
221221
return false;
222222
}
223-
if (lastRecipe != null && !lastRecipe.value().isSpecial()) {
224-
if (player instanceof ServerPlayer serverPlayer && world.getGameRules().getBoolean(GameRules.RULE_LIMITED_CRAFTING) &&
225-
!serverPlayer.getRecipeBook().contains(lastRecipe)) {
226-
//If the player cannot use the recipe, don't allow crafting
227-
return false;
223+
if (lastRecipe != null) {
224+
player.triggerRecipeCrafted(lastRecipe, craftingInput.items());
225+
if (!lastRecipe.value().isSpecial()) {
226+
if (player instanceof ServerPlayer serverPlayer && world.getGameRules().getBoolean(GameRules.RULE_LIMITED_CRAFTING) &&
227+
!serverPlayer.getRecipeBook().contains(lastRecipe)) {
228+
//If the player cannot use the recipe, don't allow crafting
229+
return false;
230+
}
231+
//Unlock the recipe for the player
232+
player.awardRecipes(Collections.singleton(lastRecipe));
228233
}
229-
//Unlock the recipe for the player
230-
player.awardRecipes(Collections.singleton(lastRecipe));
231234
}
232235
return true;
233236
}

0 commit comments

Comments
 (0)