Jump to content

Recommended Posts

Posted

Well, yes of course you can. You specified for them to have a container item...

Is there a way to make it so it does take damage but does not do the thing I described?

I changed so it doesn't have a container item, but it doesn't take damage,. It takes the whole item.

Posted

Ok, please describe exactly what you want to happen, I am having difficulty understanding what you want.

 

 

The hammer is used in crafting. It takes durability when you use it while crafting. That works.

If you take 2 tools in vanilla and put the together, they both combine.

If you take 2 hammers and put them together, they just keep making more.

This is what I mean: https://gyazo.com/9f72ca4eac19b6480703d6334948fbff

It just lets me make more.

I was wondering how do I not make it repairable like that?

Posted

I see. So you want it to have a container item in one recipe but not in the other. You will have to make a custom IRecipe then and override getRemainingItems in there. The easiest would be to extend ShapedOreRecipe and just override that one method.

 

I override getRemainingItems, but what do I put in there?

I have:

	@Override
public ItemStack[] getRemainingItems(InventoryCrafting p_179532_1_) {
	return null;
}

I'm still kinda new to programming so please excuse me.

Posted

Look at the default implementation (e.g. ForgeHooks.defaultRecipeGetRemainingItems) and modify it for your needs.

I found it. But I never worked with inventory things before.

    public static ItemStack[] defaultRecipeGetRemainingItems(InventoryCrafting inv)
    {
        ItemStack[] ret = new ItemStack[inv.getSizeInventory()];
        for (int i = 0; i < ret.length; i++)
        {
            ret[i] = getContainerItem(inv.getStackInSlot(i));
        }
        return ret;
    }

 

That is what I found.

The only part I don't understand is what do I need to change?

Posted

Do you understand what the code does? Then explain it to me in your own words. Do not just read out line by line the code. Explain the function of the code itself.

I guess I don't know that much of java.

I understand some of it.

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.