Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.12.2] Repairing tool duplicates tool


Tieso2001
 Share

Recommended Posts

I have created a tool that decreases it's durability by 1 everytime you use it to craft something. This works fine, except when you try to repair the tool by combining two damaged ones. This creates a new tool and leaves the other two tools in the crafting window.

 

    @Override
    public boolean hasContainerItem(ItemStack stack)
    {
        return true;
    }

    @Override
    public ItemStack getContainerItem(ItemStack stack) 
    {
        ItemStack item = stack.copy();
        item.setItemDamage(stack.getItemDamage() + 1);
        return item;
    }

 

Is there anyway to fix this issue or exclude this repairing recipe from the code above? I have not added this repairing recipe myself but it is automatically added by minecraft or forge.

Edited by Tieso2001
Link to comment
Share on other sites

I think that this is why you should use an IRecipe implementation instead of overriding getContainerItem. 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

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
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • 1st -> https://www.curseforge.com/minecraft/mc-mods/general-disasters-1-0-1-12-2 2nd ->https://minecraftpatch.com/deadly-disasters-415551  
    • help me find in which version my mods work
    • MC Version-1.16.5-(I understand its old but the mods that are important to me haven't been updated to 1.18) Forge Version- 36.2.20 Updated all my mods and my forge version because I was having a problem with lag and now I cant even make a world because it just throws this error at me I think it might be a compatibility but I'm pretty dumb so.......   Debug-https://gist.github.com/keepinitreal247/cf97ca2dede43ce3171fd89a490f20ba
    • Hello, I am having some difficulty loading the mods I want to play with into the game. The mod is question is Litematica, (with malilib), I have downloaded both for 1.18.1 and am using the 1.18.1 Minecraft forge loader. Both mods have been moved into the mods folder but will still not show up under the Mods tab when I load up the game. Both mods have the listed type as "Executable Jar File," so I'm not sure why it isn't working. I have played with mods in different versions of the game, but have cleared them all out as they weren't ones I was using anymore, so I know it has worked before.  Some more information to note: I am trying to to load the mod into a world that I have been playing on for a bit, (solely 1.18, but I have some projects lined up here having a schematic is helpful), but I don't see that as being the reason it isn't working; I have some Vanilla tweaks resource packs loaded onto the same world; I am playing on a laptop, but it serves me well and as I said, mods have worked on it before and some larger modpacks as well, (those have been cleared off my hard drive so storage shouldn't be a problem).  I have tried everything I could think of, but it still hasn't worked: restarting and updating my laptop, signing out and back into the Minecraft launcher, downloading/installing the mods and forge in different orders, clearing out the previously used mods from the mod folder, etc.  Everything I could find online was advice for other versions, so I have no clue where to go from here.  Thank you in advance for your help.
    • Hello, I run a server on Apex and have found that every time we close out of the client and log back in, all our keys bindings are reset. It's terribly annoying. I removed mods one by one and they did not seem to cause the issue. Had tech support check the server, and nothing. It does not occur on my 1.16.5 server (run with forge). I am thinking it is a bug with the current forge. There is no error code I can see, it just resets all the keybindings. Any fixes? 
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.