Jump to content

[1.14.4] Using CookingRecipeSerializer for custom Cookingrecipe


Eisenpaulchen

Recommended Posts

I try to create a smeltingrecipe that is capable of creating diffrent results based on the nbt of the input (Enchantments shall persist from ingriedient to result). Therefore I want to create a custom-smelting recipe and use the CookingRecipeSerializer since it provides what I need. But as far as I can see it is not possible to do so, since the functional Interface that is needed in CookingRecipeSerializer is not public. I think it would be bad practise to just

rewrite the CookingRecipeSerializer exactly as it is just to access it. Is there a way around that? Or is reflection needed or even capable of that?

Link to comment
Share on other sites

Excuse me asking but do you have an example or some extra information on using Proxy without having an Implementing Object available, since in all examples I found

they passed this object to the InvocationHandler to use invoke() on the passed method. It is a new thing for me and the tutorials in the net are basicaly repeating the standard case of the Javadoc. Just asking if you had a good example if not Ill just keep searching.

Link to comment
Share on other sites

Now I ran into an unexpected problem, the furnace does not call getCraftingResult which would provide the information about the ingredients nbt instead it uses

getRecipeOutput to determine the result and thus I am unable to do as I intended. I even cant use matches and take the information about the ingreedient from there

because I have not enough Informations to map the ingriedient infs to the specific furnace in the world.

And I failed to find a proper event. Do you have an Idea to work around this?

Link to comment
Share on other sites

Oh sry of course. But there is still the problem that in getRecipeOutput I have no parameter or Information to check which of the Inventorys I saved is the right one.

I first thought that I could just row them up in a list and then always take the first one since it startet the process as the first. But of course different cooking durations make this impossible.

I would need to accsess the TEs and their left cooktime.

Link to comment
Share on other sites

Oh Id did not thought about checkin this out. Thanks for the Idea. By the way is that (the (missing ?) getCraftingResult call) something the forgeteam would add or change in the code in newer versions (assuming it has not already) and should this be put in the improvement forum? Cause I do not see a reason for the furnace not to allow the use of this mightyer method and thus saving modders this "ugly hack"

Edited by Eisenpaulchen
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.