Java Code Examples for net.minecraftforge.fml.common.ModContainer#getMetadata()

The following examples show how to use net.minecraftforge.fml.common.ModContainer#getMetadata() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiModListScroll.java    From CodeChickenCore with MIT License 5 votes vote down vote up
/**
 * Does not add the last 10 px space before the description normally starts
 * Ignores empty child mods expecting a background draw overwrite
 */
private static int calcDescY(GuiModList gui, ModContainer mod) {
    ModMetadata meta = mod.getMetadata();
    int y = 35;
    if(!!meta.logoFile.isEmpty() && ReflectionManager.getField(GuiModList.class, ResourceLocation.class, gui, "cachedLogo") != null)
        y += 65;
    y += 12; // title
    y += 40; // necessary lines
    if(!meta.credits.isEmpty())
        y += 10;
    if(!meta.childMods.isEmpty())
        y += 10;
    return y;
}
 
Example 2
Source File: VersionChecker.java    From LunatriusCore with MIT License 5 votes vote down vote up
public static void registerMod(final ModContainer container, final String forgeVersion) {
    REGISTERED_MODS.add(container);

    final ModMetadata metadata = container.getMetadata();
    if (metadata.description != null) {
        metadata.description += "\n---\nCompiled against Forge " + forgeVersion;
    }
}
 
Example 3
Source File: ClientUtils.java    From CodeChickenCore with MIT License 4 votes vote down vote up
public static void enhanceSupportersList(Object mod) {
    ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod);
    mc.getMetadata().description = mc.getMetadata().description.replace("Supporters:", EnumChatFormatting.AQUA+"Supporters:");
    GuiModListScroll.register(mod);
}