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 want to make an interface between my mod's power system and BuildCraft's MJ system. However, I have no idea how to do this.

I have dug into other mods' code, but they all seem to hardcode everything, using reflection to fetch classes, then variables, then values. To me, this seems like a stupid idea, as as soon as anything in the target mod changes, I need to rewrite my system.

 

Is there a better way? Note: I need full control over things like conversion ratio and behavior of converting machine. Ideally with my own TileEntity that takes in my power (already done) and produces MJ.

  • Author

https://github.com/BuildCraft/BuildCraft/tree/master/common/buildcraft/api/power

 

Maybe you should start by taking a look at the BuildCraft API. Hint: implement IPowerProvider

 

How can I use any of its classes directly without making them required for my mod to compile (and therefore making RotaryCraft dependent on BuildCraft)?

Import the API into your environment, then configure ant builds to exclude BuildCraft API packages and files.

 

For a peek at ant build configuration, look at pretty much any popular mod. A good mod to look at is EE-3, Pahimar has quite wonderfully documented how to use Ant. Start here, and follow the instructions.

  • Author

Import the API into your environment, then configure ant builds to exclude BuildCraft API packages and files.

 

For a peek at ant build configuration, look at pretty much any popular mod. A good mod to look at is EE-3, Pahimar has quite wonderfully documented how to use Ant. Start here, and follow the instructions.

 

You misunderstood. If I make a direct reference to a BuildCraft class, my mod becomes dependent on the existence of that class (users without will with crash with NoClassDefFound).

In fact, it won't. As long as you check to confirm that BuildCraft exists before calling any of their methods, you'll have absolutely no problems.

 

Proof:

Check out my mod's (TukMC) source. I have references to classes in the ThirstMod and IC2, and not once have I ever experienced any issues.

  • Author

In fact, it won't. As long as you check to confirm that BuildCraft exists before calling any of their methods, you'll have absolutely no problems.

 

Proof:

Check out my mod's (TukMC) source. I have references to classes in the ThirstMod and IC2, and not once have I ever experienced any issues.

 

I cannot make an implements conditional. And that class needs to exist in "vanilla RotaryCraft" as well.

I will need help in this two maybe we need to have a extra class we load later with the class loader to do this?

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.