SG setLobby - Cannot set to an empty path

Discussion in 'Plugin Development' started by mickedplay, Jun 1, 2014.

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

    mickedplay

    Hello everybody!

    I'm working on my own SG and while using /sg setLobby it throws me the folling error:
    SG error.png
    This is line 54:
    Code:java
    1. else if(args.length == 1)
    2. {
    3. if(args[0].equalsIgnoreCase("setLobby"))
    4. {
    5. if(p.isOp())
    6. {
    7. SG_data_files.fileConfigLocations.set("Lobby.world.", world); /// <<<<<<<<
    8. SG_data_files.fileConfigLocations.set("Lobby.x.", x);
    9. SG_data_files.fileConfigLocations.set("Lobby.y.", y);
    10. SG_data_files.fileConfigLocations.set("Lobby.z.", z);
    11. SG_data_files.fileConfigLocations.set("Lobby.yaw.", yaw);
    12. SG_data_files.fileConfigLocations.set("Lobby.pitch.", pitch);
    13. try
    14. {
    15. SG_data_files.fileConfigLocations.save(SG_data_files.fileLocations);
    16. p.sendMessage(SurvivalGames.prefix + "Lobby gesetzt.");
    17. }
    18. catch (IOException e)
    19. {
    20. SurvivalGames.getInstance().getLogger().severe("Die locations.yml-Datei konnte nicht gespeichert werden!");
    21. }
    22. }
    23. else
    24. {
    25. p.sendMessage(SurvivalGames.prefix + "§cDu hast keine Rechte.");
    26. }
    27. }


    File:
    Code:java
    1. public class SG_data_files
    2. {
    3. public static File fileLocations = new File("plugins/SurvivalGames", "locations.yml");
    4. public static FileConfiguration fileConfigLocations = YamlConfiguration.loadConfiguration(fileLocations);
    5. }


    Any ideas? :(

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
  2. Offline

    Arkel

    Bumping your post within an hour or so of posting it isn't going to persuade anyone to help you.
     
    xYourFreindx likes this.
  3. Offline

    mickedplay

    Arkel Posting an useless answer is not helpful.
     
  4. mickedplay Posting a pointless remark is not helpful.
     
  5. Offline

    mickedplay

    xYourFreindx You do the same.
    Don't post useless answers to MY Posts again. I'll report them.


    Any ideas somebody?
     
  6. My post WAS useful.
    It was ironic and funny. :p

    Sorry, my humor is not accepted on all platforms and may produce errors.
     
  7. Offline

    RawCode

    what about providing stacktrace as text?
     
  8. Offline

    Jade

    Don't bump in under 24 hours. Not removing posts.
     
    xYourFreindx likes this.
  9. Offline

    mickedplay

    Jade I'm not the only one who bump twice or more times within 24 hourse. And nobody say sth. to them.
    You're post is not an answer to my question.

    RawCode There's everything you need in my first post.

    Somebody who know what to do?
     
  10. Offline

    LordVakar

    mickedplay
    The rules are not to bump in under 24 hours.
    Jade was pointing out not to do that and all you say to Jade is that Jade is not answering your question?
    So everyone who posts something that's not the answer you will "report" them?
    Strange...

    Anyways can we have the full stacktrace, the raw stacktrace and not a picture?
     
  11. Offline

    mickedplay

    LordVakar I see no difference between a picture and a raw stacktraces that Shows the same
    Code:
    [10:29:39] [Server thread/INFO]: PlayerXYZ issued server command: /sg setLobby
    [10:29:39] [Server thread/ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'sg' in plugin SurvivalGames v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) ~[craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) ~[craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:956) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:817) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
    Caused by: java.lang.IllegalArgumentException: Cannot set to an empty path
        at org.apache.commons.lang.Validate.notEmpty(Validate.java:363) ~[craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at org.bukkit.configuration.MemorySection.set(MemorySection.java:163) ~[craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at org.bukkit.configuration.MemorySection.set(MemorySection.java:193) ~[craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        at play.mickedplay.SurvivalGames.loader.SG_cmd_SG.onCommand(SG_cmd_SG.java:54) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.7.9-R0.2-20140527.004937-6.jar:git-Bukkit-1.7.9-R0.1-6-g4d832c3-b3090jnks]
        ... 13 more
    
     
  12. Offline

    RawCode

    I see no difference between a picture and a raw stacktraces that Shows the same mickedplay

    are you kidding or what?
    try to copypaste something from image and tell how you did that.

    also there is no debug messages, add some and try again.
     
  13. Offline

    Ba7marker

    Try changing the "plugins/survivalgames" to plugin.getDataFolder().
     
  14. Offline

    mickedplay

  15. Offline

    Ba7marker

    mickedplay
    Check if the yaml file actually exists. I'm fairly sure it got something to do with plugins/survivor games
     
  16. Offline

    Goblom

    Your problem lies with all the "set" paths you are using.

    For example
    Code:java
    1. SG_data_files.fileConfigLocations.set("Lobby.world.", world);


    That extra '.' is what is causing it to throw an errors, this is due to the fact that it thinks there is another layer to go down.

    Code:
    Lobby:
          world: ##This is where you want the value
              ???: ##This is where its trying to set the data
    Remove that last '.' on all your "set" paths and it should work.
     
    mickedplay likes this.
Thread Status:
Not open for further replies.

Share This Page