Custom Ore Generation

Summary
COG is a very detailed ore-generation utility of the likes of CofhCore's ore generation tweaks. It has much more depth and breadth in function however, to the point where biomes and specific block meta-data, and other mods can be addressed.

COG is driven by XML scripts. If you aren't familiar with XML don't worry its fucking simple. Get a good text editor with syntax highlighting. Notepad++ works fine.

It can be downloaded it from this thread: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1291128-custom-ore-generation-first-revival

or from its curse page: https://minecraft.curseforge.com/projects/customoregen

Documentation/Wiki
http://customoregen.shoutwiki.com/wiki/Main_Page

https://github.com/lawremi/CustomOreGen/wiki

Using COG Custom OreGen
First a copy needs to be made of the CustomOreGen_Config_Default.xml and rename it CustomOreGen_Config.xml otherwise any changes made will be ignored.

There are a wealth of options and config changes that can be done here but to 'activate' the most of the mod the default import statements for configs must be changed. In the CustomOreGen_Config.xml at the bottom of this file there are sections for Standard, Mod-provided, and Custom configs. Delete all the import statements for the standard configs, and create this import statement within the 'Import Custom Configs' comment block:  This will load any config files located in the custom section effectively giving full control to every feature of the mod without worry of standard configs interfering.

Modifying COG
The standard configs provided in the /default folder are a good starting point when using COG as they provide the general structure required by mods and vanilla. You can also try your luck with the Sprocket utility to generate new configs for mods that aren't covered in COG by default, but that utility is somewhat outside the scope of this guide.

In each .xml, there's several key values that can be tweaked to achieve various results. To start with VanillaMinecraft.xml, there a handful of values that can be set on world generation. This is the UI section, which doesn't need to be set in the config file.

(Much) Further down are the actual configurations for the kinds of veins, deposits and clouds that can be chosen. These all have motherlode sizes, heights, number of segmentations, length of branches, etc. This is where the actual shape of ore deposits are defined. The details can be reviewed on the actual COG wikis where some actual math is demonstrated. Here, it will be pointed out that to have central ore deposits with long branches are best lifted from the LayeredVeins settings and re-used in other parts of your configurations if that is the desired end result.

Biome-specific oregen is possible here by setting a BiomeType tag within the Veins tag.


 * 1) todo; add details, examples, etc.

Extending COG
COG can be used to replace just about any block type with another at oregen. So for example every block of gravel can be replaced with stone, or every Diorite can be replaced with literally anything else. It can be used, for example, in tandem with Strata.

In the 'Overworld Setup' stage of a new XML file, called StrataL1.xml for example, at the initial ore removal step instead of running it against vanilla ores with vanilla stone it would be run against Strata ores being replaced by Strata stone.

So for example to replace all the first Strata layer ores with that same layer of stone this stage would look like this: 



Replace vanilla-Strata ore clusters in layer one.

The global option deferredPopulationRange  must be large enough to catch all ore  clusters (>= 32).

  

  

  

<IfCondition condition=':= ?blockExists("strata:block.minecraft.gold_ore.0:0")'> <Replaces block='strata:block.minecraft.gold_ore.0:0' weight='1.0' /> </IfCondition>

<IfCondition condition=':= ?blockExists("strata:block.minecraft.iron_ore.0:0")'> <Replaces block='strata:block.minecraft.iron_ore.0:0' weight='1.0' /> </IfCondition>

<IfCondition condition=':= ?blockExists("strata:block.minecraft.lapis_ore.0:0")'> <Replaces block='strata:block.minecraft.lapis_ore.0:0' weight='1.0' /> </IfCondition>

<IfCondition condition=':= ?blockExists("strata:block.minecraft.redstone_ore.0:0")'> <Replaces block='strata:block.minecraft.redstone_ore.0:0' weight='1.0' /> </IfCondition>

</Substitute>

</IfCondition>

This will replace all the Strata-placed ores with the Strata stone at that layer, which allows COG placement of ores in whatever formation you want. In the OreBlock/Replaces section of the config, instead of vanilla blocks being targeted those same blocks would be Strata. <IfCondition condition=':= ?blockExists("strata:block.minecraft.coal_ore.0:0")'> <OreBlock block='strata:block.minecraft.coal_ore.0:0' weight='1.0' /> </IfCondition>

<IfCondition condition=':= ?blockExists("strata:block.minecraft.stone.0:0")'> <Replaces block='strata:block.minecraft.stone.0:0' weight='1.0' /> </IfCondition>

This applies to any mod that has its own custom generation. It can be extended as far as Galacticraft if the effort is put into making the configs and testing them for errors.

Troubleshooting
COG has very good error-handling. It likely will throw an error message box generally pointing in the direction of a mismatched tag or incorrect field instead of crashing outright. Using a good text editor with syntax highlighting can alleviate troubleshooting efforts. Ore clusters that generate weird however are going to require continual tweaks to find a result you can be content with.

CoFHCore has an excellent utility when testing oregen; cofh clearblocks

It's very simple to use, centered on whatever player specified (or just the @p tag), and to target non-vanilla blocks the Block ID number must be used. Note: A vanilla block name MUST be addressed FIRST before block IDs, so preface any long strings of numeric IDs with at least 'water' else it will fail or delete the wrong thing.


 * 1) todo; clean-up, details, examples