Posted June 1, 20205 yr 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?
June 2, 20205 yr Author 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.
June 2, 20205 yr Author Wow I just managed to do it thank you very much for both showing me the Proxy thing and getting this whole recipe to work learned some nice things. Have to admit I got it working :)
June 2, 20205 yr Author 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?
June 2, 20205 yr Author The only thing I could come up with is iterating over all tile entitys via the world parameter when mathching is called, which is almost every tick for every Furnace TE I think And search for a fitting Inventory but I thought this would drag down the fps
June 2, 20205 yr Author 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.
June 2, 20205 yr Author 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 June 2, 20205 yr by Eisenpaulchen
June 2, 20205 yr Author I have not worked with GitHub yet so I would feel a bit uncomfortable trying to use it here. So if you do not mind I would make a suggestion post and learn to use Git for the future.
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.