Search in sources :

Example 11 with ModMetadata

use of net.minecraftforge.fml.common.ModMetadata in project MinecraftForge by MinecraftForge.

the class SubstitutionInjectionTest method setup.

@BeforeClass
public static void setup() {
    Loader.instance();
    Bootstrap.register();
    Loader.instance().setupTestHarness(new DummyModContainer(new ModMetadata() {

        {
            modId = "test";
        }
    }));
}
Also used : ModMetadata(net.minecraftforge.fml.common.ModMetadata) DummyModContainer(net.minecraftforge.fml.common.DummyModContainer) BeforeClass(org.junit.BeforeClass)

Example 12 with ModMetadata

use of net.minecraftforge.fml.common.ModMetadata in project SpongeForge by SpongePowered.

the class SpongeModMetadata method get.

public static ModMetadata get(String modId, String name) {
    load();
    ModMetadata meta = metadata.getMetadataForId(modId, ImmutableMap.of("name", name, "version", ""));
    if (!meta.autogenerated) {
        if (meta.name == null) {
            meta.name = name;
        }
        if (meta.version == null) {
            meta.version = "";
        }
    }
    return meta;
}
Also used : ModMetadata(net.minecraftforge.fml.common.ModMetadata)

Example 13 with ModMetadata

use of net.minecraftforge.fml.common.ModMetadata in project DynamicSurroundings by OreCruncher.

the class Presets method postInit.

@EventHandler
public void postInit(@Nonnull final FMLPostInitializationEvent event) {
    proxy.postInit(event);
    config.save();
    // Patch up metadata
    if (!proxy.isRunningAsServer()) {
        final ModMetadata data = ForgeUtils.getModMetadata(Presets.MOD_ID);
        if (data != null) {
            data.name = Localization.format("presets.metadata.Name");
            data.credits = Localization.format("presets.metadata.Credits");
            data.description = Localization.format("presets.metadata.Description");
            data.authorList = Arrays.asList(StringUtils.split(Localization.format("presets.metadata.Authors"), ','));
        }
    }
}
Also used : ModMetadata(net.minecraftforge.fml.common.ModMetadata) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 14 with ModMetadata

use of net.minecraftforge.fml.common.ModMetadata in project DynamicSurroundings by OreCruncher.

the class DSurround method postInit.

@EventHandler
public void postInit(@Nonnull final FMLPostInitializationEvent event) {
    proxy.postInit(event);
    config.save();
    // Patch up metadata
    if (!proxy.isRunningAsServer()) {
        final ModMetadata data = ForgeUtils.getModMetadata(DSurround.MOD_ID);
        if (data != null) {
            data.name = Localization.format("dsurround.metadata.Name");
            data.credits = Localization.format("dsurround.metadata.Credits");
            data.description = Localization.format("dsurround.metadata.Description");
            data.authorList = Arrays.asList(StringUtils.split(Localization.format("dsurround.metadata.Authors"), ','));
        }
    }
}
Also used : ModMetadata(net.minecraftforge.fml.common.ModMetadata) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Aggregations

ModMetadata (net.minecraftforge.fml.common.ModMetadata)14 DummyModContainer (net.minecraftforge.fml.common.DummyModContainer)6 BeforeClass (org.junit.BeforeClass)5 EventHandler (net.minecraftforge.fml.common.Mod.EventHandler)4 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 Configuration (net.minecraftforge.common.config.Configuration)2 JsonObject (com.google.gson.JsonObject)1 FileInputStream (java.io.FileInputStream)1 URL (java.net.URL)1 ForgeEventHandler (net.geforcemods.securitycraft.handlers.ForgeEventHandler)1 ItemStack (net.minecraft.item.ItemStack)1 DuplicateModsFoundException (net.minecraftforge.fml.common.DuplicateModsFoundException)1 Java8VersionException (net.minecraftforge.fml.common.Java8VersionException)1 LoaderException (net.minecraftforge.fml.common.LoaderException)1 MetadataCollection (net.minecraftforge.fml.common.MetadataCollection)1 MissingModsException (net.minecraftforge.fml.common.MissingModsException)1 WrongMinecraftVersionException (net.minecraftforge.fml.common.WrongMinecraftVersionException)1 ModSortingException (net.minecraftforge.fml.common.toposort.ModSortingException)1