MagicLib
Warning: The project is still in the early development stage.
Dependencies
- Malilib [Client-Required] (CurseForge)
- Mod Menu [Client-Optional] (CurseForge | Modrinth)
Description
A library of versatile mod dependencies.
Feature
Compat API
- Multi-version compatibility, yes, we have used a number of means to make it compatible with all the latest releases of Minecraft (1.14+) running on the Fabric Loader. How is this done? Magic :(
- We have written compatibility APIs for balancing the differences between versions. For developers maintaining multiple MC versions of mods at the same time, it is possible to ignore Mojang's changes to MC to a certain extent. You don't have to care about what Mojang has done, using the API you will easily be able to use the same code between MC versions.
Dependency check
We have added a complete dependency checking system to verify dependency availability by means of expressions and even custom predicates, who can be applied in a variety of scenarios, e.g. - MagicLibMixinPlugin provides additional dependency checking for the module, which makes up for some shortcomings of Fabric Loader, for example by setting different dependencies for the client side and the server side. - Dependency checking can also be applied to Mixin, and Mixin will only be applied if the conditions are met. - Dependency checking can also be applied to configuration management so that the configuration item is only displayed if the conditions are met. - Further features may be included in future developments.
I18n
- We have reimplemented I18n independent of MC and can set the list of alternate languages for MagicLib I18n. Mojang uses some tricks with I18n text to make some features of String.format unavailable, which is usually annoying.
Malilib extensions
- We have written a very useful configuration management module for Malilib where we will use basic data types with Java annotations to generate configuration lists wherever possible. Also, for configuration files we have included a configuration versioning system which will help you to quickly write your own custom migration solution in the event of a major change to the configuration file structure.
- We have ported some features from a higher version of Malilib to make it easier to use the same features when using Malilib adapted to a lower version of Minecraft
Development
Mappings
We are using the Mojang official mappings to de-obfuscate Minecraft and insert patches.
Document
The English doc and the Chinese doc are aligned line by line.
License
This project is available under the LGPLv3 license. Feel free to learn from it and incorporate it in your own projects.
kind of broken with the multi version thing
In reply to moupipics:
Can you describe what happened?
In reply to HendrixShen:
没事了,我之前发现这个东西不大会自动配置版本,1.18启动的时候跑了所有的版本,解包了以后就能用
In reply to moupipics:
它是这样的,fabric loader 载入内嵌模组时不会因为依赖检查失败而阻止游戏启动,正式利用这一特性来达到一个Jar适应多个MC版本,ViaFabric也是利用了这一特性
In reply to HendrixShen:
然鹅我不知道装了什么东西,Fabric阻止了启动...报的版本不兼容
In reply to HendrixShen:
Im using it on 1.19 22w13a, it says i need malilib but there isnt a compatible version out yet
In reply to tr1gonometry:
Yes, this is generally true. You can remove the constraint by modifying Malilib's fabric.mod.json. Although you can do this, Malilib's mouse wheel listener is broken on 1.19-snapshot, and sliding the mouse wheel at any time will crash the game.
In reply to HendrixShen:
ah, yeah that mouse wheel thing is unideal even if i knew how to edit the fabricmod.json