Skip to content

Integration & Compatibility

Lean's edited this page Jun 12, 2024 · 91 revisions

About

In this section you will know how to make integration with level up mod with your own mod, most of levelup is made with harmony, its highly recomended that you know what it is, in resume harmony is a ingame function patcher to overwrite/change native functions.

Normally you want to make a compatibility with the levelup mod when you need to interact with special functions from levelup, like damage calculation, or your mod explicitly patch some native functions that are not compatible with 2 mods at same time, for example the function ReceiveDamage in Entity class on LevelUP mod overwrite completly this function, and for other mod working on that function the mod will need to make a compatibility patch for that.

Checking LevelUP

To check if the LevelUP is present in the server/game context is quitly simple, what you need is just make a foreach in all mods presents in api and check if the "LevelUP" mod exist

public override void Start(ICoreAPI api)
    {
        bool levelUPCompatibility = false;
        api.ModLoader.Mods.Foreach((mod) => { if (mod.FileName == "LevelUP") levelUPCompatibility = true; });
    }

Damage

To do

Clone this wiki locally