Giter Club home page Giter Club logo

kex-docs's Introduction

Kernel Extension library mod

Kernel Extension is a library mod for InnerCore mod launcher, adding lots of new features for the mod developers, which are not exported by the InnerCore itself to Java and JavaScript API.

Using Kernel Extension shared mod API

You can use Kernel Extension API in two ways.

  1. create a ModAPICallback in your mod's main code and access the features from API object provided to you as the first and only parameter of the callback function.
ModAPI.addAPICallback("KernelExtension", function(api) {
    // api parameter is the KEX namespace in KEX API documentation
});
  1. create a ModAPICallback in the launcher.js script of your mod, thus making your mod fully dependent from Kernel Extension mod, because it won't launch while the Kernel Extension mod is not loaded into the modpack. Later, when uploading your mod to InnerCore mod browser, you'll have to add 831 to your mod's dependencies.
// launcher.js

ConfigureMultiplayer({
    name: "KEX-Dependent mod",
    version: "1.0",
    isClientOnly: false
});

ModAPI.addAPICallback("KernelExtension", function(api) {
    // checking if getKEXVersionCode function exists in API object, then calling it and checking if the version is applicable for your mod
    if(
        typeof api.getKEXVersionCode === "function" &&
        // in this case checking if the version is 3.0 or higher
        api.getKEXVersionCode() >= 300
    ) {
        // launching the mod adding the API object to its scope
        Launch({ KEX: api });
    }
});

// then, in your mod's main code, you'll be able to access the Kernel Extension API using the KEX variable (same as in documentation, so this way is very convenient for TypeScript developers using KEX API declarations)

For TypeScript mod developers

If you write your main code in TypeScript and want to get API members hints with all documentation for them, you have to download the newest declarations file from innercore-development-cloud repository and put it into TS declarations directory of your mod project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.