plugin.yml using two classes?

Discussion in 'Plugin Development' started by RedstoneForDayz, Dec 15, 2014.

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

    RedstoneForDayz

    So I have a Java Project that has two classes, and I was wondering, in the YML file, how would you add the second class in the YML? Example:

    Code:
    main: me.plugin.Ladder.KingV2
    KingV2 is the first class, and how would you add the second class to the main?
     
  2. Offline

    Lolmewn

    There's no need, you only need to add the class that extends JavaPlugin.
     
  3. Offline

    Skionz

    @RedstoneForDayz To use another class you would have to sort of communicate with it by creating a new instance, or object of that class which is necessary when registering a listener or a command executor. To actually pass data through it you need to specify the classes parameter types. An easy way to pass data to your second class is by sending an instance of your main class and using getters to grab objects. Note that if you create multiple instances of your main class an exception will be thrown.
     
    ChipDev likes this.
  4. Offline

    fujiboy4

    Make your plugin.yml look like this:

    name: <name of your plugin>
    main: me.<user>.<MainJavaFile>
    version: <any version here>
    commands:
    <command1>:
    description: <description>
    usage: /<Command>


    Hope this helps. :D
     
Thread Status:
Not open for further replies.

Share This Page