Skip to content

Unification Config

Relentless edited this page Sep 23, 2023 · 9 revisions

Description

The unify config can be used to configure the the way recipes are unified.

Location: config/almostunified/unify.json
If you don't find the config, make sure you already loaded a world once.

Explanation

Key Description Example
modPriorities List of mods defining the priority order for dominant items.
higher = more priority
["minecraft", "kubejs", "crafttweaker", "create"]
stoneStrata List of stone types used to filter different variants in recipe results. ["nether", "deepslate", "granite", "diorite", "andesite"]
tags List of tags used for unification.
Using {material} inside a tag will work as a placeholder for all materials from the materials list below.
["forge:nuggets/{material}", "forge:ingots/{material}", "silicon"]
materials List of the materials the {material} placeholder from above is replaced with. ["iron", "gold", "emerald", "bronze"]
priorityOverrides Override the priority mod for a specific tag. {"forge:ingots/tin": "mekanism"}
customTags Add items to existing or new tags. See below
tagOwnerships Specify tags that should be converted to other tags. See below
tagInheritance Specify item or block tags that should be inherited by dominant items. See below
ignoredTags List of tags to ignore for unification.
Placeholders like {material} can't be used here.
["forge:nuggets/copper"]
ignoredItems List of item IDs to ignore for unification.
supports regex
["minecraft:iron_ingot"]
ignoredRecipeTypes List of recipe types to ignore for unification.
supports regex
["minecraft:smelting"]
ignoredRecipes List of recipe IDs to ignore for unification.
supports regex
["minecraft:iron_ingot_from_blasting"]
hideJeiRei Whether items that are no longer in use are automatically hidden from JEI or REI true or false

Custom Tags

Custom tags allow you to add items to existing tags or to completely new tags without the need for an additional tool like KubeJS, CraftTweaker or datapacks.

The structure of the config option is as follows:

"customTags": {
  "some:tag": [
    "some:item",
    "some:other_item"
  ]
}

The key of the object is the tag you want to add items to. The value array contains all items that should be added to the tag.
The tag as well as all items need to be valid resource locations. If the tag doesn't exist, it will be created automatically.

Tag Ownerships

This option allows you define tags that should be converted to other tags.
Tags that group other under them are called owner tags while the tags that are grouped are called reference tags.

An owner tag can host multiple reference tags. Owner tags must be part of the unify tag list while reference tags should not.

This feature can be used to merge tags with different formats so that all recipes can make use of them.

Example

Let's say some mods use the tag forge:coals to group their custom coal items while another mod is using forge:gems/coal. Both of them also add recipes where they use their own tags. When you define both of these tags in the unify config, the recipes will be unified but they will never use the same ingredients because the tags differ. And they are also not detected as duplicates.

The same principle could be applied to Fabric, where some mods use the convention c:tin_ingots while other mods use the Forge styled variant c:ingots/tin.

To solve this problem, you can define the config option like this:

"tagOwnerships": {
  "forge:coals": [
    "forge:gems/coal"
  ],
  "c:tin_ingots": [
    "c:ingots/tin",
    "some_mod:tin_ingots"
  ]
}

As you can see, you can assign multiple reference tags to an owner tag.

The unification will automatically add all items of each reference tag to the owner tag and then replace all occurrences of the reference tags in recipes with the owner tag.
After that, it will automatically hide all items of the grouped tags that are not the dominant item.

Tag Inheritance

This option allows you to define tags that should be inherited by dominant items.
There are two different options for defining item tags and block tags.

Item Tag Inheritance

Looking at item tag inheritance, the following example could be used if a mod decides to have their own iron ingot variant which you want to use instead of the vanilla one.

"itemTagInheritanceMode": "deny",
"itemTagInheritance": {
  "minecraft:beacon_payment_items": [
    "c:iron_ingots",
    "forge:ingots/iron"
  ]
}

Assuming you set up the rest of the config correctly, so that the new iron ingot is the dominant one, Almost Unified will automatically hide the vanilla iron ingot from JEI/REI and transform all recipes so they output the new iron ingot.

However, as you may know, there are plenty of game mechanics that depend on tags, such as the beacon payment items.
If the mod author of the new iron ingot didn't add the tag minecraft:beacon_payment_items to their item, the game mechanic would not work with the new iron ingot.

Instead of messing with tags yourself, you can now use Almost Unified directly to add the tag to the new iron ingot.
The key within the itemTagInheritance object has to be the tag you want to allow inheritance for. And the value array needs to contain all unify tags that should be allowed to inherit it.
Remember that unify tags are tags that you defined in your unify config. The tag will only be inherited by the dominant item.

Block Tag Inheritance

Block tags are often used by mods to define which blocks can be used for specific structures or even multiblocks.

The config for block tags works pretty much like the config for item tag inheritance but the key has to be a block tag instead.
The value array, however, still needs to contain unify item tags. This is because Almost Unified will work based on the item tags of the blocks.

Think about a scenario where you have two mods adding a steel block. Mod A also has a multiblock that makes use of the steel block via its block tag but you want mod B to take priority. Sadly, mod B's steel block doesn't have the required tag so it wouldn't be valid for mod A's multiblock structure.
Since mod B's steel block doesn't have the block tag, it wouldn't be possible to define it in the config. That's why you have to use the item tag instead.

This example could look like this:

"blockTagInheritanceMode": "deny",
"blockTagInheritance": {
  "mod_a:valid_multiblock_block": [
    "c:steel_blocks",
    "forge:storage_blocks/steel"
  ]
}

Tag Inheritance Mode

Possible values: allow, deny
Default value: allow

The tag inheritance mode will define how the inheritance config objects are being used.
By default, the mode is set to allow meaning you have to explicitly allow inheritance for tags.

If you set the mode to deny, you have to explicitly deny inheritance for tags. This means that if you don't define any tags in the config while the mode is set to deny, all tags will be inherited by the dominant item. This behavior is not recommended because it can lead to unexpected results.

Default Config

Forge

{
  "modPriorities": [
    "minecraft",
    "kubejs",
    "crafttweaker",
    "create",
    "thermal",
    "immersiveengineering",
    "mekanism"
  ],
  "stoneStrata": [
    "stone",
    "nether",
    "deepslate",
    "granite",
    "diorite",
    "andesite"
  ],
  "tags": [
    "forge:nuggets/{material}",
    "forge:dusts/{material}",
    "forge:gears/{material}",
    "forge:gems/{material}",
    "forge:ingots/{material}",
    "forge:raw_materials/{material}",
    "forge:ores/{material}",
    "forge:plates/{material}",
    "forge:rods/{material}",
    "forge:wires/{material}",
    "forge:storage_blocks/{material}",
    "forge:storage_blocks/raw_{material}"
  ],
  "materials": [
    "aeternium",
    "aluminum",
    "amber",
    "apatite",
    "bitumen",
    "brass",
    "bronze",
    "charcoal",
    "chrome",
    "cinnabar",
    "coal",
    "coal_coke",
    "cobalt",
    "constantan",
    "copper",
    "diamond",
    "electrum",
    "elementium",
    "emerald",
    "enderium",
    "fluorite",
    "gold",
    "graphite",
    "invar",
    "iridium",
    "iron",
    "lapis",
    "lead",
    "lumium",
    "mithril",
    "netherite",
    "nickel",
    "obsidian",
    "osmium",
    "peridot",
    "platinum",
    "potassium_nitrate",
    "ruby",
    "sapphire",
    "signalum",
    "silver",
    "steel",
    "sulfur",
    "tin",
    "tungsten",
    "uranium",
    "zinc"
  ],
  "priorityOverrides": {},
  "customTags": {},
  "tagOwnerships": {},
  "itemTagInheritanceMode": "allow",
  "itemTagInheritance": {},
  "blockTagInheritanceMode": "allow",
  "blockTagInheritance": {},
  "ignoredTags": [],
  "ignoredItems": [],
  "ignoredRecipeTypes": [
    "cucumber:shaped_tag"
  ],
  "ignoredRecipes": [],
  "itemsHidingJeiRei": true
}

Fabric

{
  "modPriorities": [
    "minecraft",
    "kubejs",
    "crafttweaker",
    "create",
    "techreborn",
    "modern_industrialization",
    "indrev"
  ],
  "stoneStrata": [
    "stone",
    "nether",
    "deepslate",
    "granite",
    "diorite",
    "andesite"
  ],
  "tags": [
    "c:{material}_nuggets",
    "c:{material}_dusts",
    "c:{material}_gears",
    "c:{material}_gems",
    "c:{material}_ingots",
    "c:{material}_raw_materials",
    "c:{material}_ores",
    "c:{material}_plates",
    "c:{material}_rods",
    "c:{material}_blocks",
    "c:{material}_wires",
    "c:{material}_storage_blocks",
    "c:raw_{material}_ores",
    "c:raw_{material}_blocks",
    "c:raw_{material}_storage_blocks"
  ],
  "materials": [
    "aeternium",
    "aluminum",
    "amber",
    "apatite",
    "bitumen",
    "brass",
    "bronze",
    "charcoal",
    "chrome",
    "cinnabar",
    "coal",
    "coal_coke",
    "cobalt",
    "constantan",
    "copper",
    "diamond",
    "electrum",
    "elementium",
    "emerald",
    "enderium",
    "fluorite",
    "gold",
    "graphite",
    "invar",
    "iridium",
    "iron",
    "lapis",
    "lead",
    "lumium",
    "mithril",
    "netherite",
    "nickel",
    "obsidian",
    "osmium",
    "peridot",
    "platinum",
    "potassium_nitrate",
    "ruby",
    "sapphire",
    "signalum",
    "silver",
    "steel",
    "sulfur",
    "tin",
    "tungsten",
    "uranium",
    "zinc"
  ],
  "priorityOverrides": {},
  "customTags": {},
  "tagOwnerships": {},
  "itemTagInheritanceMode": "allow",
  "itemTagInheritance": {},
  "blockTagInheritanceMode": "allow",
  "blockTagInheritance": {},
  "ignoredTags": [],
  "ignoredItems": [],
  "ignoredRecipeTypes": [
    "cucumber:shaped_tag"
  ],
  "ignoredRecipes": [],
  "itemsHidingJeiRei": true
}