I need to call a function from the IC2 (mod) API from within my bukkit plugin.
How would i go about importing the IC2 API into the plugin so i can call the function?
To give you an idea as to why i would want to do this;
Below is a piece of javascript that does exactly what i need. But this script runs off a plugin called ScriptCraft which lets you make plugins with javascript. I want this script to be implemented into it's own plugin with java so i don't need ScriptCraft.
cl = __plugin.getClass().getClassLoader().getParent();
ic2 = cl.loadClass("ic2.core.IC2").newInstance();
net = ic2.network;
dmm = cl.loadClass("net.minecraftforge.common.DimensionManager").newInstance();
worlds = dmm.getWorlds();
for(var wid in worlds){
var te = worlds[wid].field_73009_h;
for (var ti=0;ti<te.size();ti++){
if(te.get(ti).getFacing!=undefined){
net.updateTileEntityField(te.get(ti),"facing")
}
}
}
I can see what it is doing and how. I just don't know how to be able to run IC2's updateTileEntityField() in a bukkit plugin.
edit: I have started to convert it to java, but i didn't get far before running into a problem.
NetworkManager ic2 = new ic2.core.IC2().network;
DimensionManager dmm = new net.minecraftforge.common.DimensionManager();
?? worlds = dmm.getWorlds(); //What Data Type?
The problem is in the last line. getWorlds() asks for a in[] data type, which eclipse says does not exist.