Jump to content

[1.9.4] OreDictionary.registerOre() not working


HaiDozo

Recommended Posts

Here I go asking simply stupid questions again, or is it stupidly simple questions ;)

 

I'm trying to make my custom brick work as the vanilla brick with the ore dictionary.

I'm registering it like this (it's called by CommoProxy.init()):

 

 

public static void initCrafting() {
    OreDictionary.registerOre("ingotBrick", ItemManager.clinkerBrickItem);

    GameRegistry.addSmelting(ItemManager.essenceChunkItem, new ItemStack(ItemManager.clinkerItem), 1.0f);
    GameRegistry.addRecipe(new ItemStack(ItemManager.clinkerBrickItem), "AA", "AA", 'A', ItemManager.clinkerItem);
    GameRegistry.addRecipe(new ItemStack(BlockManager.clinkerBrickBlock), "AA", "AA", 'A', ItemManager.clinkerBrickItem);
}

 

The recipies (which also uses clinkerBrickItem) and smelting work fine but not the ore dictionary.

I'm trying to make a flower pot in game with my bricks; no go.

I looked up "ingotBrick" from some list online, I'm just assuming it's the right one for smelted single brick :P

I also tried OreDictionary.registerOre("ingotBrick", new ItemStack(ItemManager.clinkerBrickItem)); which also didn't work.

 

Tell me where I went wrong :)

Link to comment
Share on other sites

Normal recipes and Ore recipes are different.

You should register ShapedOreRecipe instead of just using normal recipe registration.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

You can easily change your code, because the constructor of ShapedOreRecipe gets the same parameter as GameRegistry#addRecipe that you used.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

I don't follow...

I still have to register all the recipes the item has? Granted brick only has two so it's easy but what if I made a plank, planks have like 11 different recipes, or maybe an item from a mod where I don't even know all the recipes?

Link to comment
Share on other sites

Nope, I said that ShapedOreRecipe will do the trick. It will accept every items registered as the ore.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockSifter), true, new Object[] {"PBP","PbP", 'b', Items.bucket, 'P', "plankWood", 'B', Blocks.iron_bars}));

 

(Huh, even I know that

new Object[]{}

isn't actually needed due to the syntatic sugar of

varargs...

and I still ended up with it in my own code in a few places.  Lets clean that up...)

 

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockSifter), true, 

      "PiP","PbP", 'b', Items.bucket, 'P', "plankWood", 'i', Blocks.iron_bars));

 

Notice how the planks are a string while the other two are specific item/block references.

 

Here's another, no specific items.

 

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockMill,9), true, 

      "SSS","SWS","SSS", 'S', "stone", 'W', "logWood"));

 

Do note that the output must be a specific item. You can't have an oredict result (e.g.

new ShapedOreRecipe("stone",...)

).  Best bet in that case (say, you're crafting bronze ingots) is to just use your own mod's version and make sure that it's been registered with the ore dictionary.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I think I've done a poor job at describing what I want to do and for that I apologize.

 

Both of you are describing the reverse of what I'm trying to do.

Your example specifies the item you wanna craft (blockSifter, blockMill). I wanna be able to craft all and any items that exists at present or future that uses that material. I don't know (or want to know) the item to craft, or the recipe, I wanna define that a material can be used as a substitute for another material.

 

Example: sticks can be crafted with 2 Oakwood planks BUT it can ALSO be crafted with Birchwood planks, or Spruce, or Jungle or Acacia etc. I wanna add another material, say Deadwood planks that can be used in place of the others, to craft .. anything that can be crafted with the other wood types, be it sticks, workbenches or bowls. Well in my case I want an alternative to bricks but it's the same concept.

 

Does that make sense?

Link to comment
Share on other sites

Due to modders abusing it and fucking up everyone elses' recipies the mechanic for automatically replacing ordict recipes is no longer in place for modders to use.

You have to manually duplicate all vanilla recipes that you want to convert to oredicts.

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

I was afraid that was the case.

So in 1.9 you can no longer have intermod oredictionary materials unless you know the other mod?

Like, you can no longer craft, say a Thermal expansion Copper block out of Tinkers' Copper ingots and vice versa (If those mods were available for 1.9) without the other mod knowing of/having access to the other?

 

(Perhaps that's why it's taking so long for those big technical mods to go to 1.9, a lot of manual work.)

Link to comment
Share on other sites

No, it was about the Vanilla recipes.

For ore recipes, you can still do it using ShadedOreRecipe/ShapelessOreRecipe.

It also accepts the ore id instead of the ItemStack itself.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

No, it was about the Vanilla recipes.

For ore recipes, you can still do it using ShadedOreRecipe/ShapelessOreRecipe.

It also accepts the ore id instead of the ItemStack itself.

 

Yes, but still, now you have to know about the other mod and it's recipes and manually add each to your mod (with Shape/lessOreRecipe), right?

I'm sure Thermal Expansion hasn't scanned through the Tinkers' recipes and added them to itself (in 1.7) but now with 1.9 they will have to do this, if I understand this correctly.

 

So in 1.7 "MyFancyCopper" could be used to make Thermal Expansion copper things (without modifying TE), but in 1.9 this is no longer possible unless Thermal Expansion discovers the existence of my mod and specifically added MyFancyCopper into Thermal Expansion.

 

Hmm... that kinda makes the ore dictionary completely non-functional, which sounds unlikely to me, which makes me doubt my understanding of this topic. I just might be a doofus haha.

 

EDIT:

Hold my horses! I think I understand everything now!

 

OreDictionary.registerOre(MyWonderfulStuff) == other mods can use MyWonderfulStuff but MyWonderfulStuff can't be used to make vanilla things?

 

Is this correct?

Link to comment
Share on other sites

OreDictionary.registerOre(MyWonderfulStuff) == other mods can use MyWonderfulStuff but MyWonderfulStuff can't be used to make vanilla things?

 

Registering an ore like that means that your item "counts as" whatever oredict name you used.  Let's say "ingotIron"

 

Now all mods that use Shaped/ShapelessOreRecipes that use ingots of iron in them will work with your item.

 

Vanilla recipes should also work because Forge should be replacing the vanilla recipes for the more common ingredients itself (that is: "stone" "planks" "iron" and "gold"; that's what was going on when I peeked into the OreDict last).  However, I am not 100% on this because of what Lex said.  You'll have to figure that out for yourself.

 

What I think he was referring to was a system that let people go "find me recipes that use/result in [item] so I can replace them with oredict recipes."  And people were fucking with other modder's recipes that way.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

If a recipe is an ore recipe, it will accept any item from any mod registered under the ore name(s) used as ingredients. If a recipe is a non-ore recipe, it will only accept the specific items used as ingredients.

 

For most vanilla items it adds to the ore dictionary, Forge will replace vanilla recipes that use the item with the corresponding ore recipes.

 

Mods can choose to add ore recipes or non-ore recipes (this also applies to machine recipes, not just crafting) and choose which ingredients of their ore recipes are ore names and which are specific items.

 

This hasn't changed since 1.7.10.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Just tested for fun:

OreDictionary.registerOre("plankWood", ItemManager.clinkerBrickItem);

works! My item can be used as wood, but:

OreDictionary.registerOre("ingotBrick", ItemManager.clinkerBrickItem);

doesn't work, my item cannot be used as brick.

(ingotBrick taken from http://www.minecraftforge.net/wiki/Common_Oredict_names)

 

So... SOME items (e.g. plankWood) can indeed be "oreDict'ed" to craft vanilla stuff while others (e.g. ingotBrick) cannot.

It was the BRICK all along causing mayhem. Mystery solved as far as I'm concerned :D

 

Fruitful discussion, thanks all!

Link to comment
Share on other sites

Yeah, if you look at the OreDictionary class you can find out what recipes from Vanilla have been dict'd.  There's a few cobblestone items last I checked that weren't as well (cobblestone wall, cobblestone stairs).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.