sethome

Discussion in 'Plugin Development' started by Harmings, Aug 14, 2013.

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

    Harmings

    I'm making a /sethome and /home but I came to a problem, whenever I sethome it sets and saves but I cant /home unless I /reload, how can I fix this?
     
  2. Offline

    herpingdo

    Give us some code, an error, something! We can't help you if we don't know what piece of code is causing what problem!
     
  3. Offline

    Harmings

    Ok, here's my code - http://pastebin.com/4bNkABzT
     
  4. First off, I think this:
    Code:java
    1. public File file = new File("plugins/HauntedTeams", "homes.yml");

    Should be:
    Code:java
    1. public File file = new File("plugins" + File.separator + "HauntedTeams"
    2. + File.separator + "homes.yml");

    Then the rest of the code looks fine. Can we see the /home command code?
     
  5. Offline

    Harmings

    There are no errors in my code its just like when I sethome I cant go to it until I reload my server
     
  6. Harmings
    Reload your config file after the player sets their home.
     
  7. Offline

    Harmings

    How do I reload my config? I tried
    this.cfg.reload(this.file);
    but it didn't work
     
  8. Offline

    tommycake50

    You don't hardcode the Path :C you do new File(getDataFolder(), "homes.yml");
     
  9. Try:
    Code:java
    1. this.plugin.reloadConfig();
     
  10. Offline

    Harmings

    There are no errors with this.plugin.reloadConfig(); but I didn't seem to do anything I still have to manually /reload to go to the home
     
  11. Offline

    Twisted_Panda

    Code:
    this.getConfig().options().copyDefaults(true);
    this.saveConfig();
    Try this, what I use for my /sethome
     
Thread Status:
Not open for further replies.

Share This Page