mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-05-07 00:00:45 +00:00
Test #304 set the location using the setters location, not the players location.
Support for offlline players
This commit is contained in:
parent
f58fa10686
commit
39770cd46d
2 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue