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

I'm creating a mod, and in order for me to control it I want to stop any mod from altering it's recipes or functions.

 

I want to see if a mod is altering the crafting array, and which mod is doing it.

My current setup involves cloning the list and storing it in a separate class during pre-initialization, then during initialization check to see if they are the same.

 

The problem with that solution is it's unclear which mod is altering the array, and also mods may add their own recipes during pre-initialization, which would indicate a flaw. Also, if the mod that alters the array loads before my mod, then the clone of the array will be the same as the altered array, meaning that the mod could get around the checks.

 

How would I go about doing this while allowing mods that add recipes during pre-init (which they shouldn't be doing) not trigger the check?

I don't think this is a good idea. Every "protection" (I can think of) can be circumvented, if some modder would want to modify your recipes, he/she (if knowledgeable enough) will.

 

If I understood it correctly what you're doing then you're checking if any mod changed crafting list (e.g. added it's own recipe using only its stuff) - you should check only your recipes. But even then one might (via reflection) change internals of your recipe so you'd have to do a deep checking. But then some mod could change your backup copy of your recipes (reflection?). Or the mod could just wait until you make a check and modify all recipes later. You could check all your recipes periodically, but that would cost some player's resources and could be still circumvented - e.g. just before your check just switch to "good" recipe set and after check switch again. Or via ASM rewrite crafting code entirely. There is surely more ways of protection and more ways of bypassing...

 

You can't really have 100% control over your recipes - it all boils down to whether other modders respect your wish regarding recipe changes.

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

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.