Loading individual classes.

Discussion in 'Plugin Development' started by MrCyberMonkey, Sep 26, 2012.

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

    MrCyberMonkey

    I've been working on a plugin for my server, which will have a bunch of basic commands, some listeners and custom events being implemented. Though I've been having many unsuccessful attempts at making it organized how I'd like to have it. With some research I found that essentials uses a very similar way.

    Basically I'm looking to have the main directory contain the main class, then two folders containing the classes for Listeners, and Commands.

    Now the predicament in this scenario, is how to load up all of the classes within the Commands folder, and the Listeners folder from the main file.

    Thanks ahead of time, and any help is appreciated.
     
  2. Offline

    Supertt007

    The "folders" you are referring to are called packages. You don't need to "load" those classes inside the packages. You can just import them into your main plugin class
     
  3. Offline

    JazzaG

    Code:
    // Register listener
    getServer().getPluginManager().registerEvents(Listener, Plugin);
    // Register commands
    getCommand(String).setExecutor(CommandExecutor); 
    
     
Thread Status:
Not open for further replies.

Share This Page