Posted June 9, 201312 yr 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!
June 9, 201312 yr The server doesn't need natives because all of the Minecraft natives are client-only (keyboard/mouse input, rendering, &c.) It's largely your choice where you put the server native; I would recommend putting it somewhere inside the directory where the server jar is. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
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.