Jump to content

[1.8]Crafting Table Checking


Recommended Posts

How can I have the player's crafting instance refreshed if he changes the size of the Itemstack from within the crafting grid.  i.e. How can I call the matches method from IRecipe, and how can I check if the player changed the size of the stack?


I have a custom Recipe that depends on the size of the ItemStack.

Link to comment
Share on other sites

So, what automatically calls "matches"?  If I can solve this, I won't have to make another crafting table for just this one thing.






copper coin -> silver coin.  Requires 64 copper coins in one slot.


//This one

silver coin -> copper coin.  Requires 1 silver coin in one slot.

//and this one have the same recipe, it's the amount required that is different.

silver coin -> gold coin.  Requires 64 silver coin in one slot.


gold coin -> silver coin.  Requires 1 gold coin in one slot.




The recipes are added into a custom recipe handler, so it can accept both of those.  I just need the output in the crafting table to update when the player adds items to a slot that already has items.

i.e. slot currently has 63 silver coins, if the player makes it 64, it doesn't say he can make a gold coin.


While he could just remove the item and put it pack completely, if he doesn't do that, there is a problem after that.  The player will receive 64 copper coins and it will remove all 64 silver coins.

Link to comment
Share on other sites

Alright, so it is impossible to find the current crafting inventory instance and check if it matches my requirements to update the output?


63 copper = no output and that works.



64 copper = 1 silver coin output.



But if I add 1 to the 63 copper in the crafting matrix to make it 64, it doesn't update.



I'm fine with it being impossible for me to find the instance to update it, just say so.




Link to comment
Share on other sites

Again, this is because that's not how the vanilla crafting table works.  The vanilla crafting table assumes stack sizes of 1, so when the SIZE of the stack changes it doesn't bother updating matches(), because vanilla does not care about stack size.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

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.


  • Create New...

Important Information

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