[SOLVED]Bukkit is sad?

Discussion in 'Plugin Development' started by Snwspeckle, Oct 24, 2011.

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

    Snwspeckle

    Minecraft keeps saying bukkit is sad and I have no idea why... Here is my code and plugins.yml.

    Java Code:
    Code:
    package lotc.anthony.linkaccount;
    
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import java.util.logging.Logger;
    
    
    public class Link extends JavaPlugin {
    	String playerName = "adonzo";
    	String pinCode = "Code";
    	Logger log = Logger.getLogger("Minecraft");
    
    	public void onEnable() {
    	    log.info("Link Account Plugin 0.1 has been enabled");
    	}
    
    	public void onDisable() {
    	       log.info("Link Account Plugin 0.1 has been disabled");
    	}
    	public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    		Player player = this.getServer().getPlayer(playerName);
    		if(player.hasPermission("link")) {
    			if(cmd.getName().equalsIgnoreCase("link")){
    	    		if(this.getServer().getPlayer(playerName) != null){
    	    			log.info("Player is Online");
    	    			player.sendMessage(ChatColor.BLUE + pinCode);
    	    		} else {
    	    			log.info("Player is offline");
    	    		}
    	    	return true;
    			}
    		}
    		return false;
    	}
    }
    

    YML Code:
    Code:
    name: Link Account
    main: lotc.anthony.linkaccount.Link
    version: 0.1
    authors: [Adonzo]
    commands:
       link:
          description: Links the account
          permission: link
          usage: /link
    
    SOLUTION: Remove the node "permission" from the YML file.
     
  2. Offline

    coldandtired

    Do you have PermissionsBucket installed?
     
  3. Offline

    Snwspeckle

    No, do I need to have it installed? If so, where and how do I get it?
     
  4. Offline

    nickrak

    You are missing a permissions section in your plugin.yml for the node "link".
     
  5. Offline

    Snwspeckle

    I have added this and it still saying its sad:

    Code:
    permissions:
        link:
            description: Default Link Permission
            default: op
    
     
  6. Offline

    coldandtired

    PermissionsBukkit is here.

    Using player.hasPermission("some.permission") is right, but it needs the permission manager to return true or false. (which is what PermissionsBukkit does when you've configured it.)
     
  7. Offline

    Snwspeckle

    Please delete this mods, I figured it out :)
     
  8. Mods won't delete it :)
    Add [SOLVED] to the title and edit your OP with the solution
     
Thread Status:
Not open for further replies.

Share This Page