CraftTweaker

CraftTweaker

151M Downloads

Print versions in CraftTweaker log file.

Darkhax opened this issue ยท 1 comments

commented

Feature request description
I want the version of CraftTweaker and every mod with CraftTweaker support to be printed at the top of the log file.

Feature request reason
In my experience 100% of the time I ask someone to give me their normal log file it is so I can verify the versions they are using. Putting these versions in the crt log would significantly streamline the process and broaden the scope of users that can be helped with just one log file.

Feature request dependencies
The annotation scan data used to collect things like @ZenRegister already has an association to the owning mod scan data. I've written a proof of concept using a slightly modified version of the code used to track the @ZenRegister classes.

    private void onLoadComplete(FMLLoadCompleteEvent event) {
        
        Map<String, String> versions = new HashMap<>();
        
        ModList.get().getAllScanData().stream().forEach(scan -> {
            
            scan.getAnnotations().stream().filter(a -> TYPE_ZEN_REGISTER.equals(a.getAnnotationType())).collect(Collectors.toList()).forEach(clazz -> {
                
                scan.getIModInfoData().forEach(info -> info.getMods().forEach(mod -> versions.put(mod.getModId(), mod.getVersion().toString())));
                
                //CraftTweakerRegistry.addClass(clazz); It's Private
            });
        });
        
        versions.forEach((k, v) -> System.out.println(k + " " +  v));
    }

Game Version
1.16.4 and whatever older versions.

commented

Well, would you consider a mod that has custom recipetypes to be "supported" in that context?
Like, using the RecipeManagerWrapper, they are supported to some extend.

Or is that solely for mods with explicit ZenRegister annotations?