Jump to content

[1.8] Ore Dictionary Help


LogicTechCorp

Recommended Posts

I am adding the ability to dye stone to the colored stone in my mod. It works well but I am having one issue, the light gray dye is the only dye that does not work. I am using the ore dictionary to allow the players to use dyes from other mods. My question is am I getting the ore dictionary name of the dyes correctly and if not what is the correct way of doing it.

 

Relevant Classes

 

Paint Event/Handler:

https://github.com/LogicTechCorp/Orizon-1.8/blob/master/src/main/java/orizon/util/PaintEvent.java

 

Enum Type

https://github.com/LogicTechCorp/Orizon-1.8/blob/master/src/main/java/orizon/util/EnumType.java

 

Type Utility

https://github.com/LogicTechCorp/Orizon-1.8/blob/master/src/main/java/orizon/util/TypeUtility.java

Link to comment
Share on other sites

I think your approach should work if you make sure you check all the OreIDs instead of just the first one, i.e.

String dye = OreDictionary.getOreName(id[0]);

should be

for (int idToCheck : id) {

  dye = OreDictionary.getOreName[idToCheck];

  dye = dye.toLowerCase();

    // etc

}

 

Alternatively you could  use OreDictionary.getOres(dye name) instead, to get a list of all ItemStacks that correspond to each Ore dye, and check each one to see if it matches (this is how recipes work).

 

i.e. -

(1) for red, get OreDictionary.getOres("dyeRed"); to retrieve a list of all ItemStacks which are red dye

(2) for each redDyeItemStack, check OreDictionary.itemMatches(heldItemStack, redDyeItemStack, true)

(3) repeat for all remaining dye colours

 

-TGG

 

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.