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.

[Solved] [1.10.2 / 1.8.9] How to register if mod is installed?

Featured Replies

Posted

Basically, let's say I wanted to make a mod, and I wanted to addon to Mr. Crayfishes Device Mod. I want this mod to work with, or without the mod. When the mod is not installed, don't register the things for the mod, and if it is, do register them.

 

How would I be able to execute this?

I am on my journey of making a remake of matmos, as explained here.

Well, there was a similar question a few days ago, about dependencies, which you state you do not want. (Directly referencing another mods' classes, which happen to not exist, even after checking if it was there or not = Crash when creating runtime, because you imported something that doesn't exist.)

You can see that conversation here.

 

You want to keep your code as subtle as possible. If you simply want "oh, that mod is in here, let me add this" Then simply use the Loader#isModLoaded(id) to flip a boolean, of which your item/block-registration checks before registering the specified object.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

If you absolutely need to reference another mod's files, you need to put that code into a separate class, put the relevant calls into a function, and then call that function inside an Loader#isModLoaded(id) check.

 

Ah la

https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/ores/OresBase.java#L754-L769

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.

Guest
This topic is now closed to further replies.

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.