question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should Fabric API have material unification?

See original GitHub issue

The problem

Multiple mods add the same items or blocks. Examples: tin ingot, salt, coal dust, silver ore, etc… One of the major tasks of pack devs (if not the major) that want to provide a smooth experience to their players is to identify all those duplicates, pick one variant and eliminate all the others from the pack, a process called unification. Here is what needs to be done for tin unification in AOF:

  1. Decide which tin will be kept, for example tin from Tech Reborn (TR).
  2. Use KubeJS’ replaceOutputs to make all recipes producing tin ingots, dusts, nuggets, blocks and ores, produce the variant from TR.
  3. Disable tin ore from other mods (Industrial Revolution aka. IR and Modern Industrialization aka. MI).
  4. Hide tin variants from those other mods in REI.
  5. Sadly they still appear as recipe ingredients, so use KubeJS’ replaceInputs to replace the tag input in the recipes by a techreborn:tin_x input.
  6. Remove redundant recipes, e.g. dust to ingot smelting. Having the same recipe appear 3 times in REI is not great.
  7. Repeat for every relevant material and part. For example, only MI adds gears so MI gears need to be used even if TR steel ingots are used.

Obviously this is rather fragile. Anytime a mod changes its crafting items, this leads to unification bugs that must be ironed out over multiple releases. And this requires a lot of time that not all pack devs have. It would be nice if anyone could throw a few mods together and have all of this be done automatically.

Can Fabric API do something about it?

I think the Fabric community should find a way for unification to happen automatically, whether through Fabric API or through Minecraft’s existing logic. In the absence of a Fabric API for this, I think this would be doable using the existing registry and resource pack systems:

  1. Every mod checks the registries before registering its items and blocks.
    if (!Registry.ITEM.getOrEmpty(new Identifier("c:tin_ingot")).isPresent()) Registry.register(Registry.ITEM, new Identifier("c:tin_ingot"), new Item(...));
    
  2. Block states, models and textures are done by agreeing on a standard path and letting resource packs handle conflicts.
  3. Redundant recipes are done by agreeing on a standard id and letting resource packs handle conflicts. For example c:tin/crafting/ingot_from_block.
  4. World generation does not need to be unified I think, because it’s less annoying and that requires fine-tuning anyway depending on the balance of the pack. All generated ores will be the same block anyway.

What do you think about that system? Is it good enough, or should Fabric API provide some API to make material unification easier?

In any case, I believe automatic unification for any set of mods by default would be amazing for the Fabric community.

PS: I am not sure if I explained this correctly or not, let me know if you would like a clarification.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Technici4ncommented, Mar 17, 2021

I think it’s very important for existing mods, hopefully for 1.17. If enough people share their ideas on this I am willing to work on the implementation myself. 😉

1reaction
immibiscommented, Apr 18, 2021

If it’s doable with the existing systems in a way that causes no problems, then don’t add another redundant system.

Recipes might not be easy to standardize - in which case a module could remove redundant recipes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UnifyTags - Customization - Minecraft - CurseForge
UnifyTags is an item unifier similar to InstantUnify and UniDict. It works through KubeJS and unifies items in the world, items in your...
Read more >
Mod developers, should I start modding with fabric or forge ...
No, Fabric is not inherently optimized. It just does less things.
Read more >
How To Make A Fabric Minecraft Server (Fabric Modded Server!)
This server can have any Fabric mods added to it from minimap mods to ... Download Fabric API : https://TheBreakdown.xyz/FabricAPI Download ...
Read more >
What is a data fabric? - IBM
This has made the unification and governance of data environments an increasing ... However, a data fabric can allow decision-makers to view this...
Read more >
A comparative assessment and unification of ... - Springer Link
In most cemented materials, where particle packings are dense, bonds tend to be short and stocky. Timoshenko beam theory will also correctly ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found