AlmostReliable / almostunified

A Minecraft mod to unify resources.
https://www.curseforge.com/minecraft/mc-mods/almost-unified
57 stars 11 forks source link

[1.20.1] tag inheritance #57

Closed rlnt closed 1 year ago

rlnt commented 1 year ago

This pull request implements tag inheritance. Preferred items will be able to inherit item and block tags from the unified items.

This allows obtaining tags from unified items that are required for gameplay mechanics. A good example would be beacon payment items or mods that use block tags for specifying valid blocks for multiblock structures.

The feature is config-controlled. By default, it does nothing. Two new config options will be populated automatically. This will not break existing configs.

Implementation notes

Example

A really cursed example just to show the functionality. Keep in mind that at least two different namespaces are required or the items won't be unified.


{
  "tagOwnerships": {
    "c:iron_ingots": [  // treat silicon and coal as if they were iron ingots
      "c:silicon",
      "c:coal"
    ],
    "minecraft:planks": [  // treat budding blocks as if they were planks
      "c:budding_blocks"
    ]
  },
  "itemTagInheritance": {  // allow inheriting the beacon payment item tag on the dominant item of the coal tag
    "minecraft:beacon_payment_items": [
      "c:coal"
    ]
  },
  "blockTagInheritance": { // allow inheriting the pickaxe mineable block tag on the dominant item of the planks tag
    "minecraft:mineable/pickaxe": [
      "minecraft:planks"
    ]
  }
}