Search in sources :

Example 1 with Person

use of net.fabricmc.loader.api.metadata.Person in project meteor-client by MeteorDevelopment.

the class AddonManager method init.

@Init(stage = InitStage.Pre)
public static void init() {
    // Meteor pseudo addon
    {
        METEOR = new MeteorAddon() {

            @Override
            public void onInitialize() {
            }
        };
        ModMetadata metadata = FabricLoader.getInstance().getModContainer("meteor-client").get().getMetadata();
        METEOR.name = metadata.getName();
        METEOR.authors = new String[metadata.getAuthors().size()];
        if (metadata.containsCustomValue("meteor-client:color"))
            METEOR.color.parse(metadata.getCustomValue("meteor-client:color").getAsString());
        int i = 0;
        for (Person author : metadata.getAuthors()) {
            METEOR.authors[i++] = author.getName();
        }
    }
    // Addons
    for (EntrypointContainer<MeteorAddon> entrypoint : FabricLoader.getInstance().getEntrypointContainers("meteor", MeteorAddon.class)) {
        ModMetadata metadata = entrypoint.getProvider().getMetadata();
        MeteorAddon addon = entrypoint.getEntrypoint();
        addon.name = metadata.getName();
        addon.authors = new String[metadata.getAuthors().size()];
        if (metadata.containsCustomValue("meteor-client:color"))
            addon.color.parse(metadata.getCustomValue("meteor-client:color").getAsString());
        int i = 0;
        for (Person author : metadata.getAuthors()) {
            addon.authors[i++] = author.getName();
        }
        ADDONS.add(addon);
    }
}
Also used : ModMetadata(net.fabricmc.loader.api.metadata.ModMetadata) Person(net.fabricmc.loader.api.metadata.Person) Init(meteordevelopment.meteorclient.utils.Init)

Aggregations

Init (meteordevelopment.meteorclient.utils.Init)1 ModMetadata (net.fabricmc.loader.api.metadata.ModMetadata)1 Person (net.fabricmc.loader.api.metadata.Person)1