Making a recipe that uses any damage value

Started by BirdstarCat13 on Sat, 09/23/2017 - 19:05

Topic category: Advanced modding

Last seen on 15:24, 10. Mar 2018
Joined Aug 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Making a recipe that uses any damage value
Sat, 09/23/2017 - 19:05

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
Sat, 09/23/2017 - 19:13

Use OreDictionary.WILDCARD_VALUE as metadata parameter for the ItemStack of the dye.

Last seen on 15:24, 10. Mar 2018
Joined Aug 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Use OreDictionary.WILDCARD
Sat, 09/23/2017 - 20:06

@#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
Sat, 09/23/2017 - 21:39

Instead of Items.DYE use new ItemStack(Items.DYE,1,OreDictionary.WILDCARD_VALUE)

Last seen on 15:24, 10. Mar 2018
Joined Aug 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Instead of Items.DYE use new
Sun, 09/24/2017 - 02:00

@#2 Thanks a bunch! :D

Last seen on 15:24, 10. Mar 2018
Joined Aug 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Okay nevermind...I did what
Sun, 09/24/2017 - 02:18

Okay nevermind...I did what you posted and it thre thw "problematic mod" error

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Okay nevermind...I did what
Fri, 10/13/2017 - 14:59

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.

Last seen on 15:24, 10. Mar 2018
Joined Aug 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Thanks! I'll try that
Sun, 11/12/2017 - 16:11

Thanks! I'll try that