Plugin does not load anymore... one or many issues?

Discussion in 'Plugin Development' started by PluginStudios, Mar 3, 2014.

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

    PluginStudios

    Hey bukkit forums. I'm trying to develop a Minecraft prison plugin, basically doing everything for you. I have just started it and it's already stopped working. It used to work with the signs, which I haven't touched, which leads me to be that it's not starting up. If you want the console log just ask, I need to start up the server again.

    I am also giving the plugin.yml and config.yml because I am horrible at both of these.
    Just a side note, I know the code is very messy :)

    Main Code
    Code:java
    1. package me.DeadEnd78.PluginMashupTester;
    2.  
    3.  
    4.  
    5.  
    6. import org.bukkit.Bukkit;
    7. import org.bukkit.ChatColor;
    8. import org.bukkit.Color;
    9. import org.bukkit.Material;
    10. import org.bukkit.block.Sign;
    11. import org.bukkit.command.Command;
    12. import org.bukkit.command.CommandSender;
    13. import org.bukkit.entity.Player;
    14. import org.bukkit.event.EventHandler;
    15. import org.bukkit.event.Listener;
    16. import org.bukkit.event.block.Action;
    17. import org.bukkit.event.block.SignChangeEvent;
    18. import org.bukkit.event.player.PlayerInteractEvent;
    19. import org.bukkit.event.player.PlayerJoinEvent;
    20. import org.bukkit.plugin.PluginManager;
    21. import org.bukkit.plugin.java.JavaPlugin;
    22.  
    23.  
    24. public class Main extends JavaPlugin implements Listener{
    25. public void onEnable(){
    26. PluginManager pm = Bukkit.getPluginManager();
    27. pm.registerEvents(this, this);
    28. getConfig().addDefault("Users.DeadEnd78.rank", "A");
    29.  
    30. getConfig().options().copyDefaults(true);
    31. saveConfig();
    32. }
    33. @EventHandler
    34. public void onSignCreate(SignChangeEvent sign){
    35. Player player = sign.getPlayer();
    36. if(sign.getLine(0).equalsIgnoreCase("[Rankup]")){
    37. player.sendMessage(ChatColor.AQUA + "[PrisonHelper] Rankup sign created!");
    38. sign.setLine(0, ChatColor.AQUA + "[Rankup]");
    39. sign.setLine(1, ChatColor.AQUA + "Click me");
    40. sign.setLine(2, ChatColor.AQUA + "To rank up");
    41. sign.setLine(2, ChatColor.AQUA + "A");
    42.  
    43.  
    44. }
    45.  
    46. }
    47. @EventHandler
    48. public void onPlayerJoinEvent(PlayerJoinEvent join) {
    49. Player player = (Player) join;
    50. join.getPlayer().sendMessage("test");
    51.  
    52. if (getConfig().getString(join.getPlayer().getName()) == null) {
    53. getConfig().addDefault("Users." + join.getPlayer().getName() + ".rank", "A");
    54.  
    55. saveConfig();
    56.  
    57. } else {
    58. join.getPlayer().sendMessage(getConfig().getString("WLCM").replace("&red", "\u00A7$2"));
    59.  
    60.  
    61. }
    62.  
    63.  
    64. }
    65. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    66. if (commandLabel.equalsIgnoreCase("rankup")) {
    67. if (sender instanceof Player) {
    68.  
    69.  
    70. Player player = (Player) sender;
    71. player.sendMessage("Your Rank Is: " + getConfig().getString(player.getName()));
    72.  
    73.  
    74. } else sender.sendMessage("You have to be in the game to send this message!");
    75.  
    76.  
    77. }
    78. return false;
    79. }
    80. @EventHandler
    81. public void mobdamage(PlayerInteractEvent e) {
    82. if(e.getAction() == Action.RIGHT_CLICK_BLOCK) {
    83. Player signplayer = e.getPlayer();
    84.  
    85. if(e.getClickedBlock().getType() == Material.SIGN || e.getClickedBlock().getType() == Material.SIGN_POST || e.getClickedBlock().getType() == Material.WALL_SIGN) {
    86. Sign sign = (Sign) e.getClickedBlock().getState();
    87.  
    88. if(sign.getLine(0).equalsIgnoreCase(ChatColor.AQUA + "[Rankup]")) {
    89.  
    90.  
    91.  
    92. if (sign.getLine(2).equalsIgnoreCase(ChatColor.AQUA + "A")) {
    93. sign.setLine(2, ChatColor.AQUA + "B");
    94. sign.update();
    95. // to do: update in config
    96. } else e.getPlayer().sendMessage(ChatColor.AQUA + "[PrisonRankme]" + ChatColor.RED + "Incorrect Sign Format");
    97.  
    98. }
    99.  
    100. }
    101. }
    102. }
    103. }
    104.  

    plugin.yml
    Code:
    name: PluginMashupTester
    version: 1
    description: Prison Helper
    author: DeadEnd78
    main: me.DeadEnd78.PluginMashupTester.Main
    commands:
      rankup:
        description: Rank up!
    config.yml
    Code:
    # Thank you for using PrisonHelper! This is the simple config, if you
    # need help just ask on the forum page or look for a video tutorial!
    WLCM: &1TEST
    Users:
    
     
  2. Offline

    ShadowLAX

    Nothing looks detrimentally wrong. Is there a stacktrace whenever you enable the plugin?
     
  3. Offline

    Bammerbom

    PluginStudios
    1) Error please
    2) this project won't be accepted on bukkit because this: getConfig().addDefault("Users.DeadEnd78.rank", "A");
     
  4. Offline

    PluginStudios

    ShadowLAX yes there is TONS of errors, involving stack trace, unable to load, etc.

    Jhtzb why won't it be accepted?

    I will work on getting the error

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

    KingPsychopath

    It adds you, to a group.
    Anybody using the plugin would automatically have you added to a group on the plugin run, despite their disapproval of it.
     
  6. Offline

    PluginStudios

    KingPsychopath ohhh.... I see now. But why do other plugins pass through this? They have defaults with their names.

    I will remove that line. Thanks :)
     
  7. Offline

    Bammerbom

  8. Offline

    PluginStudios

    Jhtzb Here it is. It's the only plugin installed.
    It is the plugin.yml causing the error. I don't know why though, because the plugin.yml worked before.

    Code:
    [11:52:28 ERROR]: Could not load 'plugins/PluginMashupTester.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:257) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.java:255) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.<init>(CraftServer.java:233) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.PlayerList.<init>(PlayerList.java:63) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:424) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    Caused by: org.yaml.snakeyaml.scanner.ScannerException: null; mapping values are not allowed here
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:733) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:305) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:179) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:563) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:146) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:123) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:411) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:188) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:252) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        ... 8 more
    
     
  9. Offline

    Bammerbom

    PluginStudios
    I have no idea, but try changing:
    version: 1
    to
    version: 1.0
     
  10. Offline

    PluginStudios

    I fixed this by removing the spaces before the words in the plugin.yml

    I was just using the example from the wiki..... somebody needs to change that.

    Thanks for your help guys!
     
Thread Status:
Not open for further replies.

Share This Page