Jump to content

Crazy crafting recipe request - two outputs, 4 billion combinations


Reika

Recommended Posts

I have two items (not blocks) that I want to be able to be crafted together and swap their metadata values (damage values). The problem is, this relies on two abilities I am not sure exist within the recipe system:

 

One, it must have two output items - neither can be consumed (I am fine with destroying one and recreating it, but I do not want to have to do things like edit the player's inventory directly, as that will lead to bugs).

 

Two, and more ominously, it must be simultaneously metadata-independent (works for every combination of values), yet still determine the outputs from said metadata values. This may seem like a simple problem, solvable with a two-layer for loop, but seeing as each item can have metadata up to the limit - 65535 - I do not want to add 4 billion recipes to the game.

 

How would I accomplish this, or is it impossible?

Link to comment
Share on other sites

I would need someone to teach me how to do that.

I assume you're using eclipse. In your project explorer right-click, select new->Class. Under Interfaces add IRecipe. That will create a class for you. Then you  can register it with GameRegistry.addRecipe(new YourRecipe()); The method names in IRecipe are pretty self-explanatory.

Every other time I have seen someone mention implementing IRecipe, they actually meant writing my own version. That is why I thought this was harder than it is.

Also, how to modify the metadata of (and not consume) the other item?

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.