basic jar mod loader
@@ -3,23 +3,32 @@ package unknowndomain.engine.mod;
import unknowndomain.engine.api.mod.ModContainer;
import unknowndomain.engine.api.mod.ModManager;
+import java.io.File;
import java.util.List;
public class SimpleModManager implements ModManager {
+ //TODO: receive home directory of the game and direct to mods folder
+ private JavaModLoader javaModLoader = new JavaModLoader(new File("/mods/").toPath());
+
@Override
public ModContainer getMod(String modId) {
+ ModContainer container = javaModLoader.getModContainer(modId);
+ if(container != null) return container;
+ //TODO: there might be more mod loader
return null;
}
@Override
public boolean isModLoaded(String modId) {
- return false;
+ //TODO: there might be more mod loader
+ return javaModLoader.getLoadedMods().containsKey(modId);
}
@Override
public List<ModContainer> getAllLoadedMods() {
- return null;
+ //TODO: there might be more mod loader
+ return javaModLoader.getLoadedModsList();
}
}
