Plugin won't load

Discussion in 'Plugin Development' started by C0lA_K1nG, Mar 22, 2014.

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

    C0lA_K1nG

    My plugin won't load for some reason

    Code:java
    1. package net.avionic.ineed;
    2.  
    3. import java.util.HashMap;
    4.  
    5. import org.bukkit.Bukkit;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.entity.Player;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class ineed extends JavaPlugin {
    12. public HashMap<String, Long> cooldowns = new HashMap<String, Long>();
    13. private int cooldownTime = 0;
    14.  
    15. @Override
    16. public void onEnable(){
    17. getLogger().info("iNeed has been enabled");
    18. getConfig().options().copyDefaults(true);
    19. saveConfig();
    20. }
    21.  
    22. @Override
    23. public void onDisable() {
    24. getLogger().info("iNeed has been disabled");
    25. }
    26.  
    27. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    28. Player player = (Player) sender;
    29. if (cmd.getName().equalsIgnoreCase(getConfig().getString("Command"))){
    30. if(player.hasPermission("iNeed.Ask")){
    31. if (this.cooldowns.containsKey(player.getName())) {
    32. long secondsLeft = ((Long)this.cooldowns.get(player.getName())).longValue() / 1000L + this.cooldownTime - System.currentTimeMillis() / 1000L;
    33. if (secondsLeft > 0L){
    34. String Cooldown_Message = getConfig().getString("Cooldown_Message").replaceAll("{name}", sender.getName());
    35. sender.sendMessage(getConfig().getString("Prefix") + " " + Cooldown_Message + secondsLeft);
    36. return true;
    37. }
    38. } this.cooldowns.put(sender.getName(), Long.valueOf(System.currentTimeMillis()));
    39. String Message = getConfig().getString("Message").replaceAll("{name}", player.getName());
    40. Bukkit.broadcastMessage(getConfig().getString("Prefix" + " " + Message));
    41. }
    42. else
    43. {
    44. player.sendMessage(getConfig().getString("Prefix") + " " + getConfig().getString("Permission"));
    45. return false;
    46. }
    47. }
    48. else
    49. {
    50. sender.sendMessage("This command can't be executed from the console!");
    51. }
    52. return true;
    53. }
    54. }
    55.  


    Console Error: http://pastebin.com/3B48AXig
     
  2. Offline

    Epicballzy

    Have you set the plugin.yml correctly?
     
  3. Offline

    C0lA_K1nG

    Yes i have

    Code:
    name: iNeed
    main: net.avionic.ineed.ineed
    version: 1
    depend: [Factions]
    commands:
        ineed:
          description: Ask to join a faction
        need:
          description: Ask to join a faction
        find:
          description: Ask to join a faction
        ask:
          description: Ask to join a faction
        join:
          description: Ask to join a faction
    permissions:
        ineed.ask:
            description: Allow a player to shout!
            default: true
     
  4. Offline

    TnT Retired Staff

    Locked. Unfortunately you have chosen not to use our software. As unofficial builds may change how your code works in unexpected ways, we are unable to provide support on our forums. Please seek out the forums for the software of your choice for support developing your plugins.
     
Thread Status:
Not open for further replies.

Share This Page