mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-31 06:07:34 +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)
|
||||
new SmartGive(data.getPlayer()).give(result);
|
||||
recipe.getRecipe().getTriggers().forEach(trigger -> trigger.whenCrafting(data));
|
||||
|
||||
// Play sound
|
||||
if (!hasOption(RecipeOption.SILENT_CRAFT))
|
||||
|
@ -56,7 +56,6 @@ public class UpgradingRecipe extends Recipe {
|
||||
recipe.getUpgradeData().upgrade(recipe.getMMOItem());
|
||||
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());
|
||||
|
||||
// Play sound
|
||||
|
@ -191,9 +191,6 @@ public class CraftingStationView extends PluginInventory {
|
||||
// Remove from crafting queue
|
||||
playerData.getCrafting().getQueue(station).remove(recipeInfo);
|
||||
|
||||
// Apply triggers
|
||||
recipe.getTriggers().forEach(trigger -> trigger.whenCrafting(playerData));
|
||||
|
||||
// Play sounds
|
||||
CustomSoundListener.stationCrafting(result, player);
|
||||
if (!recipe.hasOption(Recipe.RecipeOption.SILENT_CRAFT))
|
||||
@ -250,6 +247,7 @@ public class CraftingStationView extends PluginInventory {
|
||||
if (recipe.getRecipe().whenUsed(playerData, ingredients, recipe, station)) {
|
||||
recipe.getIngredients().forEach(ingredient -> ingredient.takeAway());
|
||||
recipe.getConditions().forEach(condition -> condition.getCondition().whenCrafting(playerData));
|
||||
recipe.getRecipe().getTriggers().forEach(trigger -> trigger.whenCrafting(playerData));
|
||||
|
||||
updateData();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user