mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-04 18:09:54 +01: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
@ -6,6 +6,7 @@ import java.util.Calendar;
|
|||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@ -26,7 +26,11 @@ public class Commandsethome extends EssentialsCommand
|
|||||||
if (user.isAuthorized("essentials.sethome.others"))
|
if (user.isAuthorized("essentials.sethome.others"))
|
||||||
{
|
{
|
||||||
User usersHome = ess.getUser(ess.getServer().getPlayer(args[0]));
|
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 New Issue
Block a user