Search in sources :

Example 1 with EnumHolder

use of net.minecraftforge.fml.common.discovery.asm.ModAnnotation.EnumHolder in project MinecraftForge by MinecraftForge.

the class ConfigManager method loadData.

public static void loadData(ASMDataTable data) {
    FMLLog.fine("Loading @Config anotation data");
    for (ASMData target : data.getAll(Config.class.getName())) {
        String modid = (String) target.getAnnotationInfo().get("modid");
        Multimap<Config.Type, ASMData> map = asm_data.get(modid);
        if (map == null) {
            map = ArrayListMultimap.create();
            asm_data.put(modid, map);
        }
        EnumHolder tholder = (EnumHolder) target.getAnnotationInfo().get("type");
        Config.Type type = tholder == null ? Config.Type.INSTANCE : Config.Type.valueOf(tholder.getValue());
        map.put(type, target);
    }
}
Also used : ASMData(net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData) ParameterizedType(java.lang.reflect.ParameterizedType) Type(java.lang.reflect.Type) EnumHolder(net.minecraftforge.fml.common.discovery.asm.ModAnnotation.EnumHolder)

Aggregations

ParameterizedType (java.lang.reflect.ParameterizedType)1 Type (java.lang.reflect.Type)1 ASMData (net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData)1 EnumHolder (net.minecraftforge.fml.common.discovery.asm.ModAnnotation.EnumHolder)1