Jump to content

[1.12.2] Using OreDictionary and ignoring damage


Recommended Posts

Posted

I've made an item that acts as a water bucket but is damageable. I added it to the ore dictionary entry "listAllwater", added by Pam's harvestcraft.

However, when I craft something, it only works when the item is undamaged. I registred the item to oredict like this:

OreDictionary.registerOre("listAllwater", new ItemStack(ItemList.waterTalisman, 1, OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("listAllwater", ItemList.waterTalisman);

Both methods don't seem to work when the item is damaged. What am I doing wrong?

 

(btw, I'm crafting this recipe from Pam's Harvestcraft):

{
  "result": {
    "item": "harvestcraft:saltitem"
  },

  "ingredients": [
    {
      "type": "forge:ore_dict",
      "ore": "toolPot"
    },
    {
      "type": "forge:ore_dict",
      "ore": "listAllwater"
    }
  ],
  "type": "forge:ore_shapeless"
}

 

Posted
On 9/30/2018 at 2:27 AM, Tschipp said:

{  "type": "forge:ore_dict", "ore": "listAllwater" }

You might want to try adding the data wildcard value

 

..."ore": "listAllWater", "data": 32767 }

((2^(16-1))-1)

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)

Posted

Can you just have your own recipe override theirs?

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)

Posted
5 hours ago, Cadiboo said:

You might want to try adding the data wildcard value

 

..."ore": "listAllWater", "data": 32767 }

((2^(16-1))-1)

I just tested it by changing the recipe in pam's assets, but it still only crafts when the item is undamaged...

Is this a limitation by oredict?

Posted
3 hours ago, diesieben07 said:

Looking at the code, this should work fine. If the ItemStack registered with the OreDictionary has a metadata of OreDictionary.WILDCARD_VALUE, any metadata should be accepted.

That's what I also was thinking... well I guess I'll just stick around for the OreDictionary rewrite for 1.13 :P

Posted

That is incorrect, due to Mojang's re-write of the recipe system, the wildcard is just a shortcut to for(ItemStack subitem : item.getSubItems())
Damageable items do not work in simple recipes as the auto fill and matching system Mojang wrote doesn't support them.

 

Recipes have to explicitly state they want to use a damageable item.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.