Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.