Abstract Command Class?

Discussion in 'Plugin Development' started by Potatoez_, May 12, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    Potatoez_

    Hello all, I was wondering how I would create a class that would "handle" commands. This wording may be terrible but I want to create a big core plugin with a lot of commands, and I was looking at the source code for Essentials and found that all of the command classes extend EssentialsCommand. I want to create a class like that. How would I do this?

    Example: https://github.com/essentials/Essen.../earth2me/essentials/commands/Commandafk.java
     
  2. Offline

    Horsey

    You do not need to do this. Essentials is VERY large, so the 'EssentialsCommand' class stores all the methods, so that the commands class can just use code like this:
    Code:
    toggleAfk(user);
    You would need to make two classes, one for methods, and one for registering the commands and then have the commands class extend the methods class.
     
  3. Offline

    Potatoez_

    Thank you!
     
  4. Offline

    Horsey

    If your problem has been solved, please mark your thread as solved in Thread Tools!
     
Thread Status:
Not open for further replies.

Share This Page