mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-03-10 12:59:11 +01:00
Triggers now apply when using the recipe (not when claiming item from the queue)
This commit is contained in:
parent
dccfcbb2b8
commit
6c9b02bc8a
@ -200,7 +200,6 @@ public class CraftingRecipe extends Recipe {
|
|||||||
|
|
||||||
if (result != null)
|
if (result != null)
|
||||||
new SmartGive(data.getPlayer()).give(result);
|
new SmartGive(data.getPlayer()).give(result);
|
||||||
recipe.getRecipe().getTriggers().forEach(trigger -> trigger.whenCrafting(data));
|
|
||||||
|
|
||||||
// Play sound
|
// Play sound
|
||||||
if (!hasOption(RecipeOption.SILENT_CRAFT))
|
if (!hasOption(RecipeOption.SILENT_CRAFT))
|
||||||
|
@ -56,7 +56,6 @@ public class UpgradingRecipe extends Recipe {
|
|||||||
recipe.getUpgradeData().upgrade(recipe.getMMOItem());
|
recipe.getUpgradeData().upgrade(recipe.getMMOItem());
|
||||||
recipe.getUpgraded().setItemMeta(recipe.getMMOItem().newBuilder().build().getItemMeta());
|
recipe.getUpgraded().setItemMeta(recipe.getMMOItem().newBuilder().build().getItemMeta());
|
||||||
|
|
||||||
castRecipe.getRecipe().getTriggers().forEach(trigger -> trigger.whenCrafting(data));
|
|
||||||
Message.UPGRADE_SUCCESS.format(ChatColor.YELLOW, "#item#", MMOUtils.getDisplayName(recipe.getUpgraded())).send(data.getPlayer());
|
Message.UPGRADE_SUCCESS.format(ChatColor.YELLOW, "#item#", MMOUtils.getDisplayName(recipe.getUpgraded())).send(data.getPlayer());
|
||||||
|
|
||||||
// Play sound
|
// Play sound
|
||||||
|
@ -191,9 +191,6 @@ public class CraftingStationView extends PluginInventory {
|
|||||||
// Remove from crafting queue
|
// Remove from crafting queue
|
||||||
playerData.getCrafting().getQueue(station).remove(recipeInfo);
|
playerData.getCrafting().getQueue(station).remove(recipeInfo);
|
||||||
|
|
||||||
// Apply triggers
|
|
||||||
recipe.getTriggers().forEach(trigger -> trigger.whenCrafting(playerData));
|
|
||||||
|
|
||||||
// Play sounds
|
// Play sounds
|
||||||
CustomSoundListener.stationCrafting(result, player);
|
CustomSoundListener.stationCrafting(result, player);
|
||||||
if (!recipe.hasOption(Recipe.RecipeOption.SILENT_CRAFT))
|
if (!recipe.hasOption(Recipe.RecipeOption.SILENT_CRAFT))
|
||||||
@ -250,6 +247,7 @@ public class CraftingStationView extends PluginInventory {
|
|||||||
if (recipe.getRecipe().whenUsed(playerData, ingredients, recipe, station)) {
|
if (recipe.getRecipe().whenUsed(playerData, ingredients, recipe, station)) {
|
||||||
recipe.getIngredients().forEach(ingredient -> ingredient.takeAway());
|
recipe.getIngredients().forEach(ingredient -> ingredient.takeAway());
|
||||||
recipe.getConditions().forEach(condition -> condition.getCondition().whenCrafting(playerData));
|
recipe.getConditions().forEach(condition -> condition.getCondition().whenCrafting(playerData));
|
||||||
|
recipe.getRecipe().getTriggers().forEach(trigger -> trigger.whenCrafting(playerData));
|
||||||
|
|
||||||
updateData();
|
updateData();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user