MouseTweaks icon indicating copy to clipboard operation
MouseTweaks copied to clipboard

[Suggestion] Support for mods to customize tweaks without dependencies

Open MarioSMB opened this issue 3 years ago • 4 comments

As suggested here: https://github.com/SlimeKnights/TinkersConstruct/issues/4967#issuecomment-1208797638
It would be nice if mods would be able to apply a container tag rather than needing to include Mouse Tweaks as a dependency. Support for Tinker's Construct is partially broken without this.

MarioSMB avatar Aug 09 '22 02:08 MarioSMB

Hm, does @MouseTweaksDisableWheelTweak really require Mouse Tweaks to be loaded at runtime? I've seen a few mods use it, surely they wouldn't if it required Mouse Tweaks... That said I honestly have very little idea how to do this properly (or what a Container tag is) so maybe there's some example I could follow and some test mod with which I could test that I got it right?

YaLTeR avatar Aug 09 '22 02:08 YaLTeR

I cannot see how adding an annotation to a class would not be a runtime dependency.

As far as what a container tag is, any registry in minecraft supports tags. Its just like a block tag or an item tag, but on the container registry. Find the registry closest to the container screens and use tags from that.

KnightMiner avatar Aug 09 '22 02:08 KnightMiner

I cannot see how adding an annotation to a class would not be a runtime dependency.

The idea was to have an "api" type dependency with the annotation class, and at runtime Mouse Tweaks checks the annotation presence with reflection. I think a number of other mods also have "api" dependencies that don't require said mods loaded at runtime; it's entirely possible that I did something wrong though.

YaLTeR avatar Aug 09 '22 02:08 YaLTeR

The mods that do that annotate a class used nowhere else in their logic (that is, that has no use without the mod the annotation is from). Not annotate a class that the mod cannot run without.

For example, JEI annotates a JEI plugin class, not my recipe class or my GUI

KnightMiner avatar Aug 09 '22 02:08 KnightMiner