Jump to content

Ore Dictionary Name as ItemStack


Kremnari

Recommended Posts

Greetings forge Dev team.

 

It seems that there would be benefit to being able to refer to Ore Dictionary Entries as ItemStacks.  Both OreRecipe classes could be merged, while enabling the Ore-ItemStacks to be referenced in code the same way as other itemstacks.  It seems only a few classes would need to be modified, mostly ItemStack to provide for the lookups, but in most of those cases we're looking to see if one ItemStack would be a member of the OreDict

 

Has any thought been given to this?

Thanks

Kremnari

 

 

ItemOreDict class - could be used to furnish the required functions with code changes (like getIconIndex) to support the transparency.  ItemDamage can be used to store the oreID.
ItemStack - would need some changes such as areItemStacksEqual (to use a lookup if item is of class ItemOreDict).
Recipe classes - would need to be modified to use areItemStacksEqual as opposed to handling that code themselves.
OreDict - would again need some similar code.

Link to comment
Share on other sites

Ive thought about this before, and really, not useful except for recipies.

Trying to mitigate the end user look and feel is a horrible ideas, as well as trying to wrap around crap like single return values for say.. getItem().

 

What is your use case, what do you wanna do?

We could in theory add a OreDictonary.isOre(String name, ItemStack item) but hooking it directly into ItemStack would just create to many issues.

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

Link to comment
Share on other sites

Recipes are where I'm working right now, and why I started thinking about this.  You're right that recipes is really the only place this would have any affect, but that is the same for OreDict entries in general.  Single return values could just focus on index 0, and display could easily be rotated (like nei) through ItemOreDict.getIconIndex() overwrite just by changing the return value.

 

I thought this would only affect the backend development. Since you've thought about this before, then I shall accept your wisdom in this matter.

 

Kremnari

 

P.S.

I was going to send my use case back channel, but I can't pm you.  Part of my mod displays recipes and it would be of benefit not to have to deal with an array of objects and check each one to cast and process.

Link to comment
Share on other sites

Meh, you'll have to deal with recipies like NEI does.

If it's a OreDict recipe and you encounter an array just loop through them when displaying them.

Anyways for doing things like always choosing index 0, or looping through the icons, it never pleases the modders and it causes nothing but fights. The oredict is mainly ment for recipies and not something the end user should ever see, so we can not officially start endorsing one thing over the others. So ya not really feasible to happen.

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

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