Jump to content

jawsawn

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by jawsawn

  1. 2 hours ago, diesieben07 said:

    If you want to do it for just once recipe you need a custom IRecipe implementation. If you want it to apply whenever the item is used in any recipe, override getContainerItem and hasContainerItem in the item class. getContainerItem will be called to determine the item that should be "left behind" when crafting.

    Can you explain more about overriding getContainerItem and hasContainerItem? Do I have to change my recipes with that?

  2. 14 minutes ago, diesieben07 said:

    No idea what you mean.

    So I have to add 

     

    @Override
    public boolean hasContainerItem()
    {
    	 return true;
    }
    @Override
    public ItemStack getContainerItemStack(ItemStack itemStack)
    {
    // copy our item.
    ItemStack returnItem = new ItemStack(itemStack.getItem(), 1, itemStack.getItemDamage()+1);

    For the item's class and all the other recipes these items been in turns into damaged recipes?

     

  3. 1 minute ago, diesieben07 said:

    Any decently coded auto-crafting mod will support IRecipe, it's not hard. You might however need to write custom NEI/JEI/whatever handlers if you want the recipe to display there, but this can be mitigated by extending from one of the existing recipe classes and only adding the add-damage functionality.

    I don't have code examples for the container item, but it should be pretty straightforward.

    Don't I have to boggle with durability decrease math with container item?

  4. 3 minutes ago, diesieben07 said:

    If you want to do it for just once recipe you need a custom IRecipe implementation. If you want it to apply whenever the item is used in any recipe, override getContainerItem and hasContainerItem in the item class. getContainerItem will be called to determine the item that should be "left behind" when crafting.

    It does matter when it comes to cross mod compat with autocrafting with IRecipe right? I'm planning to do like only 2 recipes where the item gets upgraded which should remove it. Also can you link me to "getContainerItem and hasContainerItem" example codes? Thanks for your support.

  5. I have a weak modding knowledge and a java noob, but I can work my way out if I get an example. 

    So I added 3 different items to an oredict and I want to use them in a couple of shapeless crafting recipes. I also want them to take damage upon crafting. How do I achieve that?

     

    GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.DIAMOND, 1),new ItemStack("stonePhis", 1 , OreDictionary.WILDCARD_VALUE),"ingotGold","ingotGold","ingotGold","ingotGold"));
    

    This is supposed to take any item from that oredict with any damage value but it expectedly doesn't work because  you can't have quotation marks in Itemstack. So how do I get this to work and how do I damage it upon crafting?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.