Jump to content

best practice: how and where to put natives/resources


Winthorpe

Recommended Posts

Hello!

 

I'm currently writing a mod/block that is a) a ComputerCraft peripheral with it's own api and b) depends on a native library.

 

ComputerCraft let's you load your own api using a path relative to the minecraft root. At the moment i'm creating the necessary directories in the mod's @Init procedure and extract the scripts from the mod's jar into that dir.

It works fine but I was wondering if there is a better way. Maybe load the resources directly from the jar without extracting them.

 

The mod also depends on a native library. On the client side  I could extract the .so/.dll into the bin/natives/ directory and load it using System.loadLibrary(). But where do I put it on the server side? What I've seen the server does not have a special java.library.path (at least it does not need one, not sure if any server startup scripts out there set one). Should I even try to get the library somewhere in the path or should i rather use System.load("/absolute/path/to/lib.so") to load it with an absolute path? If so, where should I extract it to? Somewhere below the minecraft root or maybe a temp directory?

 

Thanks for your help!

Link to comment
Share on other sites

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.