FastCraft icon indicating copy to clipboard operation
FastCraft copied to clipboard

RecipeManager: items are duplicated

Open frogglen opened this issue 4 years ago • 7 comments

Description

Well, I tried to make a new recipe with the RecipeManager plugin and I was able to do it correctly resulting in a named item and custom lore. The FastCraft plugin I take it and when obtaining the item from FastCraft, the ingredients do not consume them and you can do the crafting infinitely.

Server Details

Errors

frogglen avatar May 10 '20 18:05 frogglen

I can take a look at this in about an hour. Could you share the recipe with me (the file it's saved in if possible) so I can reproduce this?

On Sun, May 10, 2020, 2:08 PM frogglen [email protected] wrote:

Description

Well, I tried to make a new recipe with the RecipeManager plugin and I was able to do it correctly resulting in a named item and custom lore. The FastCraft plugin I take it and when obtaining the item from FastCraft, the ingredients do not consume them and you can do the crafting infinitely. Server Details

  • Server: Paper 1.15.2 #273
  • FastCraft: v3.1.3

I have RecipeManager v2.22.1 Errors

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BenWoodworth/FastCraft/issues/171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6SJL7X6ZIZASJHEGXE3TRQ3UTJANCNFSM4M5K7TIA .

BenWoodworth avatar May 10 '20 19:05 BenWoodworth

the recipe i made was this:

craft
wheat + wheat + wheat
wheat + poisonous_potato + wheat
nether_wart + nether_wart + nether_wart
= wheat_seeds:0:5
@name Alimento Economico
@lore Rango Bajo
@lore Sirve para alimentar Mascotas Iniciales.

you can replicate it by placing it in the recipemanager recipe folder

frogglen avatar May 10 '20 20:05 frogglen

Alright, I was able to reproduce it. I'll take a look

Before & after crafting with FastCraft: 2020-05-10_16 29 31 2020-05-10_16 29 34

BenWoodworth avatar May 10 '20 20:05 BenWoodworth

Alright, I was able to reproduce it. I'll take a look

Before & after crafting with FastCraft: 2020-05-10_16 29 31 2020-05-10_16 29 34

exactly, the resources are not spent to make the recipe, but if I do it on the normal preparation table, the custom recipe works and the materials are consumed.

frogglen avatar May 10 '20 20:05 frogglen

It looks like RecipeManager is doing something weird with the crafting events

RecipeManager is cancelling the crafting (so FastCraft won't take the ingredients, and won't give the seeds), then it's giving the players seeds itself.

I'll try to figure out how to make that work correctly, but for now, I released v3.1.4 which disables the recipes from RecipeManager

BenWoodworth avatar May 10 '20 21:05 BenWoodworth

It looks like RecipeManager is doing something weird with the crafting events

RecipeManager is cancelling the crafting (so FastCraft won't take the ingredients, and won't give the seeds), then it's giving the players seeds itself.

I'll try to figure out how to make that work correctly, but for now, I released v3.1.4 which disables the recipes from RecipeManager

thanks, i have temporarily disabled fastcraft on my server and will install the version you mention to me

frogglen avatar May 10 '20 21:05 frogglen

RecipeManager handles the CraftItemEvent: https://github.com/haveric/RecipeManager2/blob/8b3884a27bee3c268bb4e8a642383bee4be4835a/RecipeManager-base/src/main/java/haveric/recipeManager/recipes/WorkbenchEvents.java#L325

RecipeManager adds the result (seeds) to the player's inventory: https://github.com/haveric/RecipeManager2/blob/8b3884a27bee3c268bb4e8a642383bee4be4835a/RecipeManager-base/src/main/java/haveric/recipeManager/recipes/WorkbenchEvents.java#L523

RecipeManager cancels the CraftItemEvent: https://github.com/haveric/RecipeManager2/blob/8b3884a27bee3c268bb4e8a642383bee4be4835a/RecipeManager-base/src/main/java/haveric/recipeManager/recipes/WorkbenchEvents.java#L533

RecipeManager subtracts ingredients from the crafting grid: https://github.com/haveric/RecipeManager2/blob/8b3884a27bee3c268bb4e8a642383bee4be4835a/RecipeManager-base/src/main/java/haveric/recipeManager/recipes/WorkbenchEvents.java#L540

  • #subtractIngredients(Inventory, ItemResult, boolean):
    • https://github.com/haveric/RecipeManager2/blob/8b3884a27bee3c268bb4e8a642383bee4be4835a/RecipeManager-base/src/main/java/haveric/recipeManager/recipes/PreparableResultRecipe.java#L216

BenWoodworth avatar May 10 '20 22:05 BenWoodworth