Jump to content

Sparrow

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Sparrow

  1. Yes I'm aware, I'm developing a coremod which modifies base mc files I know, that's what I thought. My mod basically looks for all the .class files in a certain package in the jar. So you just open up the package and iterate through the files, instantiating a new copy of each of them as you go. The problem is that the classloader has not been made aware of the package, and thus refuses to load it. Ok, fair enough, just force the classloader to load a .class file from the package itself (like Module.class) and then it'll load up the package into memory. In the development environment, this works just fine. But as soon as it's simply inserted into a clear .jar file, Forge's classloader fails to pick up the package. I wonder if that's a fault of Forge's or something else.
  2. I'm developing a coremod. One of the things this mod does is load all the classes implementing a certain type from a certain package. By default the classloader doesn't recognize a package until it has to load a class from that package. So I force the classloader to be aware of it. In development/eclipse, this works just fine. But once the mod is added into a clean forge jar, the classloader is not finding the package no matter what I do. Some of the things I've tried: Class<Module> someModule = Module.class; //should make the classloader aware try { ClassLoader.getSystemResources("net.*"); //should load the net.sparrow package } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } try { Module.class.getClassLoader().loadClass("net.sparrow.module.Module"); //should FORCE the class to load } catch (ClassNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } Package[] knownPacks = Package.getPackages(); //prints all known packages from the classloader //note that it does NOT print aynthing from the packages described above (net.sparrow) for(int i = 0; i < knownPacks.length; i++) { FMLLog.info("Package:" + knownPacks[i], 0); } ArrayList<Class<?>> moduleList = UtilFile.getClassesForPackage(Module.class.getPackage()); //getPackage() is always returning null.
  3. Steps to reproduce: Download the Forge 867 source Install Open up in eclipse Run MC once Add Rei's Minimap Game crashes. The source of this problem seems to be something with FML. I can get this setup to work when I install 867 as a seperate profile to minecraft, add Rei's Minimap, and launch from the launcher so that's why I post here. It seems to be a dev environment problem only. Log: http://pastebin.com/5CPPDm1h
×
×
  • Create New...

Important Information

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