@@ -0,0 +1,2419 @@
+package info.u_team.u_team_core.util.annotation;%0A%0Aimport org.apache.logging.log4j.*;%0Aimport org.objectweb.asm.Type;%0A%0Aimport info.u_team.u_team_core.api.construct.*;%0Aimport info.u_team.u_team_core.api.integration.*;%0Aimport info.u_team.u_team_core.util.AnnotationUtil;%0Aimport net.minecraftforge.api.distmarker.Dist;%0Aimport net.minecraftforge.fml.ModList;%0Aimport net.minecraftforge.fml.loading.FMLEnvironment;%0Aimport net.minecraftforge.forgespi.language.ModFileScanData.AnnotationData;%0A%0Apublic class AnnotationManager %7B%0A%09%0A%09private static final Logger LOGGER = LogManager.getLogger(%22AnnotationManager%22);%0A%09%0A%09public static void constructConstructs(String modid) %7B%0A%09%09for (AnnotationData data : AnnotationUtil.getAnnotations(modid, Type.getType(Construct.class))) %7B%0A%09%09%09final String annotationModid = (String) data.getAnnotationData().get(%22modid%22);%0A%09%09%09final Boolean client = (Boolean) data.getAnnotationData().get(%22client%22);%0A%09%09%09if (modid.equals(annotationModid)) %7B%0A%09%09%09%09if (client == null %7C%7C !client %7C%7C client && FMLEnvironment.dist == Dist.CLIENT) %7B%0A%09%09%09%09%09LOGGER.info(%22Try to load construct for mod %22 + modid);%0A%09%09%09%09%09try %7B%0A%09%09%09%09%09%09Class.forName(data.getMemberName()).asSubclass(IModConstruct.class).newInstance().construct();%0A%09%09%09%09%09%7D catch (LinkageError %7C ClassNotFoundException %7C InstantiationException %7C IllegalAccessException %7C ClassCastException ex) %7B%0A%09%09%09%09%09%09LOGGER.error(%22Failed to load and construct mod construct : %7B%7D%22, data.getMemberName(), ex);%0A%09%09%09%09%09%09throw new RuntimeException(ex);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static void constructIntegrations(String modid) %7B%0A%09%09for (AnnotationData data : AnnotationUtil.getAnnotations(modid, Type.getType(Integration.class))) %7B%0A%09%09%09final String annotationModid = (String) data.getAnnotationData().get(%22modid%22);%0A%09%09%09final String integrationModid = (String) data.getAnnotationData().get(%22integration%22);%0A%09%09%09if (modid.equals(annotationModid)) %7B%0A%09%09%09%09if (ModList.get().isLoaded(integrationModid)) %7B%0A%09%09%09%09%09LOGGER.info(%22Try to load %22 + integrationModid + %22 integration for mod %22 + modid);%0A%09%09%09%09%09try %7B%0A%09%09%09%09%09%09Class.forName(data.getMemberName()).asSubclass(IModIntegration.class).newInstance().construct();%0A%09%09%09%09%09%7D catch (LinkageError %7C ClassNotFoundException %7C InstantiationException %7C IllegalAccessException %7C ClassCastException ex) %7B%0A%09%09%09%09%09%09LOGGER.error(%22Failed to load and construct integration : %7B%7D%22, data.getMemberName(), ex);%0A%09%09%09%09%09%09throw new RuntimeException(ex);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

Make new annotation manager class that bundles the construct manager and the integration manager