Question

Discussion in 'Plugin Development' started by Tolerance, Jul 8, 2013.

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

    tills13

    Did you move your plugin.yml to the root of the jar/project folder?
     
  2. Offline

    LinearLogic

    Tolerance, I'm convinced the issue is simply packaging, since your code and plugin.yml contents work fine for me. Here's the layout of a plugin; I created plugin.yml by right-clicking on the project folder (highlighted), so it isn't packaged within the src/ directory or the like.
    [​IMG]
     
  3. Offline

    Chinwe

    LinearLogic I've always put plugin.yml and config.yml in src and it's worked fine for me :0
     
  4. Offline

    xTrollxDudex

    Tolerance
    Don't swear too much dude. Last time I checked someone said there were a bunch of 8 year olds on the forums lol

    Make sure the plugin.yml is created by right clicking the plugin name, not src
     
  5. Offline

    LinearLogic

    chinwe
    Just tried it; you're right. Although it does sort of create a clutter to package YAML files in with src packages, but I suppose that's personal preference.
     
  6. Offline

    Ibix13

    The main in the plugin.yml should be me.arrived.Testing.Testing
     
  7. Offline

    LinearLogic

    Or, more conventionally, the package should be me.arrived.testing
     
  8. Offline

    Tolerance

    It is.
     
  9. Offline

    LinearLogic

    ...and the issue is persisting? Paste your classes and plugin.yml and I'll compile and test.
     
  10. Offline

    Tolerance

    LinearLogic

    I'm copying and pasting everything in a new Java Project to see if it works. If not, I'll do that.

    Thanks! :)
     
  11. Offline

    SnipsRevival

    Tolerance Please tell me you will follow package naming conventions ;)
     
  12. Offline

    Tolerance

    LinearLogic

    lol well what i did did jack shit.

    Here's my only class:
    Code:
    package me.arrived.Basic;
     
    import java.util.logging.Logger;
     
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class Basic extends JavaPlugin {
     
        Logger log = Logger.getLogger("Minecraft");
     
        public void onEnable(){
            log.info("Your plugin has been enabled!");
        }
     
        public void onDisable(){
            log.info("Your plugin has been disabled.");
        }
     
     
            public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
                    Player player = null;
                    if (sender instanceof Player) {
                        player = (Player) sender;
                    }
           
                    if (cmd.getName().equalsIgnoreCase("basic")){ // If the player typed /basic then do the following...
                        // do something...
                        return true;
                    } else if (cmd.getName().equalsIgnoreCase("basic2")) {
                        if (player == null) {
                            sender.sendMessage("this command can only be run by a player");
                        } else {
                            // do something else...
                        }
                        return true;
                    }
                    return false;
                }
    Here is my Plugin.yml:
    Code:
    name: Basic
    main: me.arrived.Basic.Basic
    version: 1.0
    author: arrived
    commands:
      basic:
          description: This is a demo command.
          usage: /<basic> [player]
          permission: testing.basic
          permission-message: You don't have the <permission> node!
    When I am exporting the file I right click the package and export it there.
     
  13. Offline

    Compressions

  14. Offline

    SnipsRevival

    Tolerance your main in your plugin.yml is not the same as your package name plus main class, and you should export your whole project not just the package.
     
  15. Offline

    Tolerance

    that was a typo lol it is i just copied the wrong thing. my bad.

    and ok i'll try exporting the whole project.

    Compressions
    ok

    2 pages later, it finally works. woooooooooh!!!!!!!! *#&@ now that's embarrassing for me how all that work and i forgot to mention that..... ksothat'sembarrising so ifanadmincandeletethis thatbegreatkthxbai

    no but srsly thanks SnipsRevival LinearLogic Ibix13 :)

    sorry for my lack of explaining but it works now so that's all that matters huehuehueuhehue

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  16. Offline

    xTrollxDudex

    Tolerance
    The main happens to be <top level domain>.<domain>.<plugin name>.<main class name>
    In your plugin.yml your main is me.arrived.db.db
     
Thread Status:
Not open for further replies.

Share This Page