Jump to content

[Solved] [1.8] Accessing Methods/Fields of another Mod


Recommended Posts

Posted

Hi,

I'm trying to add a waypoint to JourneyMap with a custom button; now, because it appears that there is no easy way of accessing a field of another mod, I would appreciate some suggestions on how I may do this (It seems like the important class is journeymap.client.waypoint.WaypointStore, but how do I access it?).

I'll be using this mod only privately, so it doesn't have to be the cleanest code.

 

Thanks for helping!

Posted

Well, if author doesn't provide dev-source which you can use to direct-reference his classes, then your best shot is to use Reflection.

 

You will simply need to check if Mod is loaded and then use Method/Field to change stuff.

Note that you should reflect method/field once and then reuse it.

 

Google Reflection tutorial.

1.7.10 is no longer supported by forge, you are on your own.

Posted

Well, I thought about using reflection, but I hoped for some (reflection-)integration in Forge itself; it seems like Reflection is my best bet right now.

 

Anyway, thanks for the help!

Posted

Maybe this helps you (bukkit programming, but you could adjust it):

When you want to edit the banlist of a server you can't do BanList.pardon(); because it's not static.

You have to do BanList.getBanList(Type.NAME).pardon();

Mabe in JourneyMap there is somethig like: WaypointManager.getWapoints().addWaypoint(...);

Bringing the best mod back alive! Our mod REFORGED!

Balkon's Weapons for 1.8: https://github.com/TheOnlySilverClaw/Reforged/releases

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.