Reika Posted April 12, 2013 Posted April 12, 2013 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? Quote Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
Reika Posted April 13, 2013 Author Posted April 13, 2013 Implement a custom IRecipe instance? I would need someone to teach me how to do that. Quote Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
Reika Posted April 14, 2013 Author Posted April 14, 2013 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? Quote Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
RANKSHANK Posted April 14, 2013 Posted April 14, 2013 I'm betting you're after Item.getContainerItemForItemStack(ItemStack). not sure if that's the exact name but you just return the corresponding itemstack Quote I think its my java of the variables.
Reika Posted April 14, 2013 Author Posted April 14, 2013 I'm betting you're after Item.getContainerItemForItemStack(ItemStack). not sure if that's the exact name but you just return the corresponding itemstack ...How does that help me here? Quote Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
Recommended Posts
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.