plugin.yml not loading?

Discussion in 'Plugin Development' started by gaz1812, May 12, 2014.

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

    gaz1812

    TheHandfish ZodiacTheories I'm still getting this:
    13.05 17:34:08 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    13.05 17:34:08 [Server] ERROR Could not load 'plugins/ChatHelp.jar' in folder 'plugins'

    Here's my code:

    CHAT CLASS:
    Code:text
    1. package me.gaz1812.ChatHelp;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.craftbukkit.Main;
    5. import org.bukkit.entity.Player;
    6. import org.bukkit.plugin.java.JavaPlugin;
    7.  
    8.  
    9. public class Chat extends JavaPlugin
    10. {
    11. static ChatComs chats;
    12. private static Chat ins = new Chat();
    13.  
    14. String prefix = "§8[§aMortality§2Chat§8] §r";
    15.  
    16. public static Main plugin;
    17.  
    18.  
    19.  
    20. public static void setup(ChatComs chatComs) {
    21. chats = chatComs;
    22. }
    23.  
    24. public String getPrefix() {
    25. return this.prefix;
    26. }
    27.  
    28. public void log(String s) {
    29. Bukkit.getConsoleSender().sendMessage(this.prefix + s);
    30. }
    31.  
    32. public void sendMessage(Player player, String s) {
    33. player.sendMessage(this.prefix + s);
    34. }
    35.  
    36. public void bc(String s) {
    37. for (Player player : Bukkit.getOnlinePlayers())
    38. sendMessage(player, s);
    39. }
    40.  
    41. public static Chat get() {
    42. // TODO Auto-generated method stub
    43. return null;
    44. }
    45. }


    CHATCOMS CLASS:
    Code:java
    1. package me.gaz1812.ChatHelp;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.command.Command;
    5. import org.bukkit.command.CommandSender;
    6. import org.bukkit.entity.Player;
    7. import org.bukkit.event.EventHandler;
    8. import org.bukkit.event.Listener;
    9. import org.bukkit.event.player.AsyncPlayerChatEvent;
    10. import org.bukkit.plugin.PluginManager;
    11. import org.bukkit.plugin.java.JavaPlugin;
    12.  
    13. public class ChatComs extends JavaPlugin
    14. implements Listener
    15. {
    16. private boolean chatLock;
    17.  
    18. public void onDisable()
    19. {
    20. super.onDisable();
    21. }
    22.  
    23. public void onEnable()
    24. {
    25. PluginManager m = getServer().getPluginManager();
    26. m.registerEvents(this, this);
    27.  
    28. Chat.setup(this);
    29.  
    30. this.chatLock = false;
    31.  
    32. super.onEnable();
    33. }
    34.  
    35. public boolean isChatLock() {
    36. return this.chatLock;
    37. }
    38.  
    39. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    40. if ((sender instanceof Player)) {
    41. Player player = (Player)sender;
    42. if ((cmd.getLabel().equalsIgnoreCase("chatclear")) && (
    43. (sender.hasPermission("ch.clear")) || (sender.isOp()))) {
    44. for (int i = 0; i <= 200; i++) {
    45. Bukkit.broadcastMessage("");
    46. }
    47. Chat.get().sendMessage(player, "§4You have sucessfully cleared the chat.");
    48. Chat.get().bc("§aChat has been cleared by: §6" + sender.getName() + "§r.");
    49. }
    50.  
    51. if ((cmd.getLabel().equalsIgnoreCase("chatlock")) && (
    52. (sender.hasPermission("ch.lock")) || (sender.isOp()))) {
    53. if (this.chatLock) {
    54. Chat.get().sendMessage(player, "§4You have unlocked chat.");
    55. Chat.get().bc("§aChat has been unlocked by: §6" + sender.getName() + "§r.");
    56. this.chatLock = false;
    57. } else if (!this.chatLock) {
    58. Chat.get().sendMessage(player, "§4You have locked chat.");
    59. Chat.get().bc("§aChat has been locked by: §6" + sender.getName() + "§r.");
    60. this.chatLock = true;
    61. }
    62. }
    63.  
    64. if ((cmd.getLabel().equalsIgnoreCase("staffchat")) && (
    65. (sender.hasPermission("ch.staff")) || (sender.isOp()))) {
    66. if (args.length == 0) {
    67. Chat.get().sendMessage(player, "§bUsage: /staffchat [message]");
    68. return false;
    69. }if (args.length >= 1) {
    70. String help = "";
    71. for (String part2 : args) {
    72. if (help != "") help = help + " ";
    73. help = help + part2;
    74. }
    75. for (Player staff : Bukkit.getOnlinePlayers()) {
    76. if ((staff.isOp()) || (staff.hasPermission("ch.staff"))) {
    77. staff.sendMessage("§4[§cStaff-Chat§4] §5: §6" + sender.getName() + " §d§l= §7" + help);
    78. }
    79. }
    80. }
    81. }
    82. }
    83.  
    84. return false;
    85. }
    86.  
    87. @EventHandler
    88. public void onChatLock(AsyncPlayerChatEvent e) {
    89. Player player = e.getPlayer();
    90. if (this.chatLock)
    91. if (player.isOp()) {
    92. e.setCancelled(false);
    93. } else {
    94. e.setCancelled(true);
    95. Chat.get().sendMessage(player, "§4Error: §bSorry! Chat is currently locked.");
    96. }
    97. }
    98. }
     
  2. Offline

    ZodiacTheories

  3. Offline

    gaz1812

    ZodiacTheories This is my plugin.yml
    Code:
    name: ChatHelp
    version: 1.0
    author: Gaz1812
    main: me.gaz1812.ChatHelp.ChatHelp
    description: Provides helpful commands to keep your chat clean!
      commands:
        chatclear:
          description: Clear the chat
          permission: ch.clear
          permission-message: §4Error: You can't do this.
          aliases: [cc]
        chatlock:
          description: Lock the chat
          permission: ch.lock
          permission-message: §4Error: You can't do this.
          aliases: [cl]
        staffchat:
          description: Private Staff Chat
          permission: ch.staff
          permissions-message: §4Error: You can't do this.
          aliases: [ch]
     
  4. Actually, YML isn't 'itchy' about spacing in terms of amount, just in terms of consistency and being parallel. Although I'm pretty sure that most do just go by the standard of 2 space indents. Also 'works' isn't at all the same as doing it the way it should be done. For one example, let's say you do that line in a plugin called Test you'll quickly encounter a problem if I do this:
    PHP:
    ((MainBukkit.getPluginManager().getPlugin("Test")).plugin null;
    Sure, I'm not saying I would do that, or that I couldn't still do harm, but should you really make it so easy?

    gaz1812 Few things:

    1) We'd need the full stack trace - would be easier
    2) Third party builds aren't supported
    3) Your problem was pointed out a long time ago.
     
  5. Offline

    Iroh

    Locked.
    We do not support developing for unofficial builds.
     
    TheHandfish likes this.
Thread Status:
Not open for further replies.

Share This Page