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

Coremodding, and bytecode instrumentation in general, are said to leads to compatibility issues with other instrumenters. This I agree with and try to avoid it as much as possible.

However, one could argue that, if they follow the principle above, no modder should ever tinker with my own code. That would mean that I am free to tinker with it without any compatibility issues.

Uses that come into mind are dynamically generated register/init methods, custom run-time methods for debugging purposes, late removal of debug statements, and a few more.

Some of these can be accomplished with other safer, albeit slower, techniques (eg. reflection), so my question is: Is the efficiency worth it?

  • Author

Alright. Is there somewhere in gradle I can put a source processor that would strip debug lines, etc? Kinda like the conditional compiling in C#

I do/did something similar:

https://github.com/Draco18s/ReasonableRealism/blob/master/build.gradle#L49

Scroll all the way to the right, that line is a list of find-replace pairs: the last one is a comment called "uncomment" that when removed enables a section of code.  I had to do this with Reika's API because it would crash Eclipse because it wasn't properly set up to be in the dev environment.  But it compiled and ran in live code just fine.  You could do the same thing with your debug statements, only in reverse.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Oh yeah, that thing. Used it for replacing stuff in my Reference class, didn't think about introducing/removing comments with it. The only issue is that I limit the scope with replaceIn() so that it doesn't go wild on other classes, and I have no idea if two replace scopes are possible with that functionality.

Just have to make sure the thing you're find/replacing isn't generic. "{uncomment}" isn't something that would ever appear anywhere else in my code,

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Sorry for reviving an old thread.

 

But isn't this what aspect-oriented programming (AspectJ in Java) is all about? And it looks useful, from what I've read about it, and quite well maintainable.

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.