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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi I have an issue with a server it solved deleting the ice and fire but my friends and me really want to use it does any of these mods are causing the issue due to incompatibility  Security craft Aquaculture Architectury Artifacts Astikorcarts Baubles BetterCaves yungs BetterStrongholds yungs BetterMineshafts yungs Bountiful Byg  Callablehorses Carry on Chococraft Citadel Clumps Collective Comforts Corailrecycler Craftable horse armor Comes alive Curios forge Decocraft Dungeonsarise  Open blocks elevator Expandability Farlanders Goblin traders Hwyla  Ice and fire Infernal expansion Jei Jump over fences Mantle  Macaws bridges Macaws doors Macaws fences Macaws furniture  Macaws fencesbyg Morpheus Mouse tweaks Mowzies mobs Obfuscate Paraglider Patchouli  Pick up notifier Random village names Spartan shields Small ships Sophisticated backpacks Spartan weaponry Storage drawers straw golem Structure gel Twilight forest  Tinkers construct Two players one horse  Valhesia core  Valhesia structures  Way stones  Vehicle mod  Wall jump Wings Wolves with armor Xptome  Xaeros minimap  Yungsapi  
    • { "type": "magic_overhaul:rune_inscribing", "base": { "item": "//base item" }, "template": { "item": "//template item" }, "output": { "count": 1, "item": "//output item" } } ^ Ok, where is your recipe JSON placed in your file structure? What's it called? And paste the actual JSON you're testing with, because it needs to be valid.
    • I'm trying to run Forge 1.12.2 on Minecraft  so I can use certain mods, but this error popped up. I've seen multiple errors but I just can't figure this one out. Unable to locate the Java runtime. Error details: 0x00000000 - system: The operation completed successfully. Filename on disk:  Path: . Exists: Directory
    • https://mclo.gs/b422RFc
    • Плагин и Приват
  • Topics

×
×
  • Create New...

Important Information

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