Solved Bukkit Coding (Warps) [SOLVED]

Discussion in 'Plugin Development' started by benzimmer123, May 8, 2014.

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

    benzimmer123

    I have been coding a warp plugin but came across a very simple but annoying problem. Every time I set a warp it overrides all the current warps set. Have no idea why! :p
    Thanks in advance! ;)

    P.S I believe this is all the code needed to solve it. Need any more just ask. ;)
    CODE:

    Code:java
    1. plugin.settings.getConfig().set("warps." + p.getName() + "." + args[1].toLowerCase() + ".z", p.getLocation().getBlockZ());
    2. plugin.settings.getConfig().set("warps." + p.getName() + "." + args[1].toLowerCase() + ".x", p.getLocation().getBlockX());
    3. plugin.settings.getConfig().set("warps." + p.getName() + "." + args[1].toLowerCase() + ".y", p.getLocation().getBlockY());
    4. plugin.settings.getConfig().set("warps." + p.getName() + "." + args[1].toLowerCase() + ".yaw", p.getLocation().getYaw());
    5. plugin.settings.getConfig().set("warps." + p.getName() + "." + args[1].toLowerCase() + ".pitch", p.getLocation().getPitch());
    6. plugin.settings.getConfig().set("warps." + p.getName() + "." + args[1].toLowerCase() + ".world", p.getLocation().getWorld().getName());
    7. plugin.settings.saveConfig();


    Never mind fixed it myself! :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page