Maybe it's my lack of imagination, but my understanding of best practices is that if I want to extend FoxBot with additional commands and functionality but still be able to easily inherit future changes then I shouldn't fork the code, I should utilize FoxBot.jar and create a new class that either creates or is a child of FoxBot and go from there.
My problem with this is that FoxBot.jar is inaccessible. I can't call the start method (why is that private, anyway?) and I can't register my own commands and listeners.
Could you please make sample java code that uses FoxBot.jar, starts it up, adds a listener, and adds a command? Making this (and the code changes required to make it work) would go a long way towards others being able to use this project.
I'd envision the sample code could be
import co.foxdev.foxbot.*;
public static void main(String[] args) {
Foxbot foxbot = new FoxBot;
foxbot.initialize(); // does everything but connect
MyCommand myCommand = new MyCommand();//MyCommand being a child of co.foxdev.foxbot.Command
foxbot.registerCommand(myCommand);
MyListener myListener = new MyListener();
foxbot.registerListener(myListener);
foxbot.start(); //initializes if not already done, then connects.
}
or maybe better yet, change your reflections property to be an array of reflections, create FoxBot.addReflections that would add to this array, and change registerListeners and registerCommands to loop through this array. Then the code simplifies to
import co.foxdev.foxbot.*;
public static void main(String[] args) {
Foxbot foxbot = new FoxBot;
foxbot.addReflections('org.foo.myextendedfoxbot');
foxbot.start();
}
I'm happy to struggle with doing these code changes myself, but first I'd like your assurance that you'd want this functionality. Do the changes I'm proposing even make sense?
Maybe it's my lack of imagination, but my understanding of best practices is that if I want to extend FoxBot with additional commands and functionality but still be able to easily inherit future changes then I shouldn't fork the code, I should utilize FoxBot.jar and create a new class that either creates or is a child of FoxBot and go from there.
My problem with this is that FoxBot.jar is inaccessible. I can't call the start method (why is that private, anyway?) and I can't register my own commands and listeners.
Could you please make sample java code that uses FoxBot.jar, starts it up, adds a listener, and adds a command? Making this (and the code changes required to make it work) would go a long way towards others being able to use this project.
I'd envision the sample code could be
or maybe better yet, change your reflections property to be an array of reflections, create FoxBot.addReflections that would add to this array, and change registerListeners and registerCommands to loop through this array. Then the code simplifies to
I'm happy to struggle with doing these code changes myself, but first I'd like your assurance that you'd want this functionality. Do the changes I'm proposing even make sense?