Jump to content

[SOLVED][1.7.2] Recipes returning part of recipe (eg. bucket)


Recommended Posts

Posted

First all, nice to be here and greetings everyone :)

 

My name is Federico, TheGoldSun on Minecraft. I'm a programmer and I recently decided to explore Forge to develop something interesting. My favourite mod is IndustrialCraft2, and actually I'm playing the experimental version, great even with bugs and unfinished mechanics. However, let me ask something to more expert modders as you are!

 

 

I wonder, how can I make an item or a block similar to buckets? I mean... Using a bucket in a recipe, the result is a new item but it returns also empty buckets. Now, of course a filled bucket (water/milk/lava ecc) has is own id, and empty bucket has another one.. So, it's there some arguments to add - may be - tu GameRegistry.addRecipe () to give player back some ItemStack? Searching in bucket classes and in Blocks and Items classes gave me no hints about it. I thought another way could be create an event handler that give player an ItemStack on the crafting of something else, but again.. no hints about that. I even thought that could be a property of item but nothing, it seems there is not anything like that in the properties or methods of Item or Block. Even possible I missed it, of course.

 

So, can anybody help me and reaveal the trick? :D

 

 

Thanks in advance, and sorry if I made some mistake explaining my question, my english is not so good.. xD

 

 

Bye!

Federico Nuzzo

Programmer and Developer

Posted

OHHH!! Well, thanks! Tomorrow I will try. If I not misunderstood, in the istance of the item i use setContainerItem(), with - as argument - the item that have to return back after crafting? However, very thanks! I'll let you know if I solve my problem. :) Good night folks!

 

 

Edit:

 

Finally I verified the method setContainerItem and it worked perfectly, very very thanks. The starting idea is something just like the "forge hammer" or the "cable cutter" in industrialcraft, a tool usable in the crafting table that decreas his health, and I'm quite near to discover how to :D Thanks. I'll modify the topit title with [sOLVED].

Federico Nuzzo

Programmer and Developer

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.