mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-18 04:21:31 +02:00
admin can set others homes. needs "essentials.sethome.others" permission
This commit is contained in:
@@ -15,8 +15,24 @@ public class Commandsethome extends EssentialsCommand
|
|||||||
@Override
|
@Override
|
||||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
||||||
{
|
{
|
||||||
user.setHome(args.length > 0 && args[0].equalsIgnoreCase("default"));
|
if (args.length > 0)
|
||||||
charge(user);
|
{
|
||||||
user.sendMessage(Util.i18n("homeSet"));
|
if (args.length < 2)
|
||||||
|
{
|
||||||
|
user.setHome(args[0].equalsIgnoreCase("default"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (user.isAuthorized("essentials.sethome.others"))
|
||||||
|
{
|
||||||
|
User usersHome = ess.getUser(ess.getServer().getPlayer(args[0]));
|
||||||
|
usersHome.setHome(args[1].equalsIgnoreCase("default"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
charge(user);
|
||||||
|
user.sendMessage(Util.i18n("homeSet"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user