Colossal Chests

Colossal Chests

26M Downloads

Dependency on CyclopsMC/CyclopsCore not specified in mcmod.info

satreix opened this issue · 6 comments

commented

I do not get the specifics of the "mcmod.info" file, but aren't we missing a runtime dependency on https://github.com/CyclopsMC/CyclopsCore in the "dependencies" section of the file?

commented

Forge accepts more dynamic dependency declaration using the @Mod annotation. But I guess I can add it to mcmod.info as well.

commented

Yes, that's how Forge handles it.

Furthermore, Forge even allows dynamic construction of the mcmod.info data, so you can not even rely on that.

The safest way to collect all mod metadata is probably by running it (possibly in a restricted sandbox), and extracting the @Mod data.

commented

The idea behind this is to work with package managers that would like to install your dependencies. Reading the mcmod.info file is pretty easy for them. I am not that familiar with the @Mod forge annotation, where are we using this is the sources? Where can I get documentation for this feature?

Thanks a lot.

commented

More information can be found at… (Coming Soon)

RTFSources then: minecraftforge/fml/common/Mod.java.

In the case of ColossalChests 1.12, we specify the following (see ColossalChests.java#L35-L42):

@Mod(
    modid = Reference.MOD_ID,
    name = Reference.MOD_NAME,
    useMetadata = true,
    version = Reference.MOD_VERSION,
    dependencies = Reference.MOD_DEPENDENCIES,
    guiFactory = "org.cyclops.colossalchests.GuiConfigOverview$ExtendedConfigGuiFactory"
)
public class ColossalChests extends ModBaseVersionable {
    // ...
}

Reference comes from :

public class Reference {
    // ...
    public static final String MOD_FORGE = "forge";
    public static final String MOD_FORGE_VERSION = "@FORGE_VERSION@";
    public static final String MOD_FORGE_VERSION_MIN = "14.21.1.2406";
    public static final String MOD_CYCLOPSCORE = "cyclopscore";
    public static final String MOD_CYCLOPSCORE_VERSION = "@CYCLOPSCORE_VERSION@";
    public static final String MOD_CYCLOPSCORE_VERSION_MIN = "0.10.9";
    // ...
    public static final String MOD_DEPENDENCIES =
            "required-after:" + MOD_FORGE       + "@[" + MOD_FORGE_VERSION_MIN       + ",);" +
            "required-after:" + MOD_CYCLOPSCORE + "@[" + MOD_CYCLOPSCORE_VERSION_MIN + ",);";
}

I think I get the idea now. One thing that bothers me though is that Forge does not allow package manager to do there job solely with the use of the mcmod.info file : according to the file spec, only the mod IDs are to be collected in the dependencies [string] key of the file, thus the versions are left out of this file and any pkg manager would need to dig into the fml of the mod to find les @Mod annotations to construct a proper dependency tree.

Does this seem to be a correct view of the current state of thing in Forge/FML world?

commented

All Cyclops mods now include a requiredMods entry in the mcmod.info file, as described by https://mcforge.readthedocs.io/en/latest/gettingstarted/structuring/#the-mcmodinfo-file.