Posted September 7, 201411 yr Don't take this question the wrong way. I know how to USE the @Mod annotation. I'm looking for a proper explanation of how the @Mod annotation actually works. I've researched a bit into annotations, but have found nothing about using it in yet-unloaded classes. I could create a random class randomClass, and as long as it's never called from any other class, it would never be loaded. But if I add the @Mod annotation to it, it will be loaded. Does Forge load and scan all the classes in a certain class path, searching for any that implement the @Mod annotation, and then loads them? Is there some really easy way to get all the classes that contain a certain annotation WITHOUT having to load every class in a certain path? Am I just missing something extremely obvious? I'm not a pro Java coder, but I have a few years experience with some of the more basic/intermediate stuff. It's always been a hobby and never something serious, so there's things I don't know that someone who studied the language properly for a few years would. I only ask this because I'm messing around with my own annotation similar to @Mod, however I can't find any way of loading the classes that contain it without loading all within a certain path. Thanks for any help guys I've been getting a lot more serious about programming recently (though less Minecraft stuff really), and this has been really frustrating me.
September 7, 201411 yr Author Thanks for the speedy reply I was hoping there was some clever way I was just missing. I thought it might have been classpath scanning. Cheers for letting me know about ASMDataTable though. I didn't realise it was accessible via PreInit. Time to have a play around with that (though it's 2 AM now haha).
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.