Started by
BirdstarCat13
on
Topic category: Advanced modding
I want to make an item which is crafted with any of the dyes in a certain pattern, but when I use the "any damage vlaue" dye in the popupwindows it just sets it to the black dye. I want to edit the source code to force it to allow any dye, because the point of the item is that you can use any combination of any dye to make the item. How do I do this? I don't want to make 16 crafting recipes.
Use OreDictionary.WILDCARD_VALUE as metadata parameter for the ItemStack of the dye.
@#1 Okay...so how would I do that?
here's my existing code:
GameRegistry.addShapelessRecipe(recStack, new Object[]{mcreator_diamondnugget.block, Items.DYE, mcreator_diamondnugget.block, Items.DYE, Items.DYE, Items.DYE, mcreator_diamondnugget.block, Items.DYE, mcreator_diamondnugget.block,});
Instead of Items.DYE use new ItemStack(Items.DYE,1,OreDictionary.WILDCARD_VALUE)
@#2 Thanks a bunch! :D
Okay nevermind...I did what you posted and it thre thw "problematic mod" error
I had the same problem when doing that way I add to add above the GameReg part if you have a ItemStack recStack add it below that
[spoiler]ItemStack newdye = new ItemStack(Items.DYE,1,OreDictionary.WILDCARD_VALUE);
GameRegistry.addShapelessRecipe(recStack, new Object[]{mcreator_diamondnugget.block, newdye, mcreator_diamondnugget.block, newdye, newdye, newdye, mcreator_diamondnugget.block, newdye, mcreator_diamondnugget.block,});[/spoiler]
This is just air code so it might bug out a little but I had to do this to access the other fish in the game so I think it should work, I not used the OreDictionry before so not sure of that part is right.
Thanks! I'll try that