Jump to content

Winthorpe

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Winthorpe

  1. Not sure about your icon problem but your error comes from the CommonProxy.getServerGuiElement() TileEntityBrickFurnace tileEntity = (TileEntityBrickFurnace)world.getBlockTileEntity(x, y, z); TileEntityStoneFurnace tileEntity1 = (TileEntityStoneFurnace)world.getBlockTileEntity(x, y, z); if(tileEntity != null) { ... } This is not a valid way to check an object type. Use instanceof instead. TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity instanceof TileEntityBrickFurnace) { ((TileEntityBrickFurnace) tileEntity).doSomething(); ... } else if (tileEntity instanceof TileEntityStoneFurnace) { ... }
  2. 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!
×
×
  • Create New...

Important Information

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