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

Is there a syntax to make all methods of a class public? With fields it was just *, but what is it with methods? 

Thanks for your help! 

The correct answer is don't and spend the time to properly utilize methods in the system. If you need to call a private or protected method outside of its context, you're most likely doing something wrong.

  • Author

What is the difference? Reflection is in run time, access transforming is done before the classes are loaded, or what? Why is it not recommended to transform methods, but fields are fine? It should not hurt other mods, right? Youre not taking away functionality, or am I missunderstanding sth? 

And do I really need to get rid of 300 lines access transformers for protected getters? (Took quite a while) 

  • Author
54 minutes ago, diesieben07 said:

If you make a method public that was previously protected you must access transform all classes that inherit from it as well because they potentially override the method (also protected). If you just make the base method public, the extending class now crashes with a IncompatibleClassChangeError, because you cannot override a public method with a protected one. Since you cannot possibly know all extending classes (you'd have to know all the mods out there), this cannot be done safely.

It is okay to do in the case of private or package private, since in those cases the possible overriding methods are either none (if the method was private) or well known (only classes in the same package apply). But even then it is only mostly safe because Minecraft uses SRG names at runtime, so the risk of someone inadvertently using the same method name in a subclass (which would then error or rather change behavior) is minute.

Yes, you do. You are breaking any mod that overrides these methods as outlined above.

Aww thanks i guess... Makes sense now. :/

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.