CottonMC / Epicurean

The food revolution for Fabric 1.15
MIT License
6 stars 5 forks source link

Fix recipe remainders for meals #26

Closed JamiesWhiteShirt closed 4 years ago

JamiesWhiteShirt commented 4 years ago

Resolves #13

I can infer that CookingResultSlot#onTakeItem is a slightly modified version of the method it overrides. By looking up CRAFTING recipes instead of MEAL recipes, a matching recipe cannot be found, resulting in no remainders. Additionally, the check for hasRecipeRemainder seems to be an unnecessary addition that only contributes to the issue.

I was unable to reproduce the duplication issue described in #12 (I had to substitute porkchops for pancakes) with these changes. If there are other ways to produce duplications, I'll need some help with testing those.

I don't believe the various overrides of Item#hasRecipeRemainder are effective. This is what the base method does:

   public boolean hasRecipeRemainder() {
      return this.recipeRemainder != null;
   }

The overrides effectively don't change anything because they match which items have the recipe remainder set in their settings and which ones do not. I have therefore removed the overrides to avoid any confusion this might cause.

LemmaEOF commented 4 years ago

Thank you very much! I was just desperate to get this to work somehow.