[SOLVED]WorldGuard API problemz, adding owner disappears on server restart

Discussion in 'Plugin Development' started by Williamsson, Feb 28, 2012.

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

    Williamsson

    I'm developing a plugin that shall give users owner rights to the region they're standing in when they type a command.
    Now, it works. I type the command, I'm the owner of the region. All is joy.

    But then I restart the server, and all of a sudden someone has taken my rights from me!
    Any idea of what I should do? :)

    Code:
    private void setOwner(Player player, RegionManager rm, String regionName) {
            DefaultDomain domain = new DefaultDomain();
            domain.addPlayer(player.getName());
         
            rm.getRegion(regionName).setOwners(domain);
            player.sendMessage("Region claimed!");
        }
    SOLVED:

    added
    try {
    rm.save();
    } catch (ProtectionDatabaseException e) {
    e.printStackTrace();
    }
    and updated plugin on server.
     
Thread Status:
Not open for further replies.

Share This Page