Skip to content
This repository has been archived by the owner on May 21, 2020. It is now read-only.

Modifying General

Xemiru / Marc Tellerva edited this page Nov 1, 2017 · 3 revisions

If you'd like to modify General code and better integrate it into something else, you may want to pay attention to the spots in code listed below:

com.github.xemiru.general.CommandContext

The context of commands should hold metadata about the execution of the command. If you have a user-based system where multiple users could call a command, you may want to add a sender property. You should probably also change the sendMessage and sendError methods.

Keep in mind that various messages from commands and errors may make use of the newline character.

At that point, the sendMessage and sendError methods residing in CommandManager may become obsolete. It's up to you whether or not they need to be kept.

com.github.xemiru.general.CommandManager

Registration and execution of commands may need to be different in some use cases. You can either delegate to the CommandManager methods, or refer to the private processCommand method in the command manager to see how you should try to reimplement command execution. The handleCommand and completeCommand methods, as well as processCommand itself may become obsolete after reimplementation.

Clone this wiki locally