Jump to content

[1.8] [EDIT] Updating crafting matrix upon changing item in a slot


DARKHAWX

Recommended Posts

EDIT: Read my third post.

 

Hi there,

I want to look into creating a method of crafting some items for my mod. However I'm having a hard time understanding how to create and implement this. If anyone can give me a brief explanation or point me to a tutorial that would be amazing.

No signature for you!

Link to comment
Share on other sites

So after a bit of tinkering I think I've gotten somewhere... Right now I have a crafting table that I can open and place blocks in, but I'm not sure if I've initialised the crafting table and recipes properly.

 

Also for some reason if I close the inventory whilst items are still in the crafting matrix, they just disappear. This was working beforehand, so I'm not sure what I broke.

 

Here is the code I have:

 

-snip-

 

I don't expect any of you to actually read through the whole code. I'm just thinking that I am not either

 

a) registering my recipes right

b) my CraftingManager isn't being registered/initialised correctly

c) my Gui/container isn't updating properly

 

If someone could check these for me, or tell me how I'm supposed to do them that would be great.

 

(also wtf am I doing wrong with the disappearing items when closing the inventory?)

 

EDIT: All the recipes will be shapeless and require a solvent and catalyst (both items, can be null), justsoyouknow

No signature for you!

Link to comment
Share on other sites

Okay, so I've now fixed my problems (I was comparing item stacks rather than the items) but have run into another one. In my gui it adds two new inventory slots (on top of the normal crafting matrix, both of which are used in the crafting), but when I change the items in them it doesn't update the crafting matrix.

 

How should I change my Slot code so that it forces the container to update and check if the items match a recipe?

No signature for you!

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.