Test #304 set the location using the setters location, not the players location.

Support for offlline players
This commit is contained in:
ementalo 2011-07-07 22:24:50 +01:00
parent f58fa10686
commit 39770cd46d
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.logging.Logger;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

View File

@ -26,7 +26,11 @@ public class Commandsethome extends EssentialsCommand
if (user.isAuthorized("essentials.sethome.others"))
{
User usersHome = ess.getUser(ess.getServer().getPlayer(args[0]));
usersHome.setHome(args[1].equalsIgnoreCase("default"));
if(usersHome == null)
{
usersHome = ess.getOfflineUser(args[0]);
}
usersHome.setHome(user.getLocation(), args[1].equalsIgnoreCase("default"));
}
}
}