Random thought about Mods with new Ores

MilConDoin

New Member
Jul 29, 2019
1,204
0
0
At which stage of mod loading (pre init, init, post init, ...) will be loaded:
- blocks for worldgen
- items
- oreDict (meaning the time when new blocks/items are registered with oreDict)?

Reason:
We currently have many mods which add the same ores (copper, tin, ...). Would it be possible to write your own mod in a way that it asks oreDict if oreCopper, ingotCopper, ... are already registered, and if yes not even start loading its own implementation?
If now every mod uses the same name in the oreDict, there would only one type of ore, ingot, ... exist per metal, so oreDictUnifiers (see GT), ForgeLexicon, ... wouldn't be needed for this basic stuff (if your own mod only ever uses the oreDict besides the initial registration). Recipes like ore doubling would simply use the first dust they find in the oreDict instead of using its own implementation and players would never again find several types of dusts and ingots of the same type in their storage or even in NEI.

Pseudocode:
Code:
if (!oreDict.exists("oreCopper"))
  Blocks.add(MyCopperOre);


Edit: Found a possible problem with my idea: What if the sequence, in which mods are loaded, changes, so that now a different mod registers its items first with oreDict? I think that would remove all your existing ingots etc. from the world, since ingotCopper now has a different itemID (e.g. ID 5000 with TE, 6000 with IC²). Is there any way around this?
 

Pokefenn

New Member
Jul 29, 2019
976
0
0
Items are registered in Pre-Init
I think that oreDictionairy is pre-init aswell, looks like that from TiC source code
And Same with worldgen.

Not 100% sure about the last 2, i havent used either.
 

King Lemming

New Member
Jul 29, 2019
664
0
0
Here's the real problem with it - control over where those ores spawn as well as what they drop. Someone could absolutely make an oreCopper that drops various other things. Hard to say.

Mods have to be balanced in a vacuum for the most part. The best we can really do is allow server admins to have full control over the config files and work it out.
 

SpitefulFox

New Member
Jul 29, 2019
1,235
0
0
At which stage of mod loading (pre init, init, post init, ...) will be loaded:
- blocks for worldgen
- items
- oreDict (meaning the time when new blocks/items are registered with oreDict)?

As far as I know, there's nothing stopping you from using any stage you want. It depends on the mod author. My mods handle block, item and oreDict registry during the init, and then check for the cross-mod things like other mods' oredict registrations during post init.

Having your mod check for the existence of other mods' copper ores isn't always safe idea. If you look in NEI in Unleashed, you'll see three copper ores, but the only one of those that actually spawns in the world is TE's due to configs. A mod could add a block to the game and register it in the dictionary without actually making it generate.
 

Omicron

New Member
Jul 29, 2019
2,974
0
0
GregTech is doing something similar in theory. It parses and intercepts any events where other mods are loading specific items, and adds them to the ore dictionary if they are not already (example: Redpower2 gems). It even throws notifications when it detects an ore dictionary call which it hasn't seen before, and asks the user to report it to GregoriousT for better cross-mod integration.

So technically the means are there. But I'm inclined to go with KingLemming's view of things - it's not a good idea to auto-defer to another mod if you can't make sure that the thing that it registers with a specific name actually does what your mod needs it to do.
 

Democretes

New Member
Jul 29, 2019
1,134
0
1
Is it possible to set all types of smelting/craft of nuggets, ores, and dusts to be set to a certain ingot? I despise it when I smelt an ore and it comes out as a non-TE ingot or an ingot that conflicts with all the other ingots I have. I know IC2 machines give their processed version of ores while TE gives its own. I'd like to be able to switch all ingots to be the same ID and texture as TE's for storage's sake and the fact that TE's textures are divine.
 

SpitefulFox

New Member
Jul 29, 2019
1,235
0
0
Is it possible to set all types of smelting/craft of nuggets, ores, and dusts to be set to a certain ingot? I despise it when I smelt an ore and it comes out as a non-TE ingot or an ingot that conflicts with all the other ingots I have. I know IC2 machines give their processed version of ores while TE gives its own. I'd like to be able to switch all ingots to be the same ID and texture as TE's for storage's sake and the fact that TE's textures are divine.

You can run all your ingots through a Unifier.
 

MilConDoin

New Member
Jul 29, 2019
1,204
0
0
Here's the real problem with it - control over where those ores spawn as well as what they drop. Someone could absolutely make an oreCopper that drops various other things. Hard to say.

Mods have to be balanced in a vacuum for the most part. The best we can really do is allow server admins to have full control over the config files and work it out.
Thanks, I totally forgot that aspect.
And once again catering for the potential of trolls works against the easiest solution ;)