mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-28 20:17:49 +01:00
Essentials.sethome.others doesn't imply essentials.sethome.multiple.
Restore essentials.home.others permission check.
This commit is contained in:
parent
6946488e0d
commit
8cc249c2d3
@ -25,7 +25,7 @@ public class Commandhome extends EssentialsCommand
|
|||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
{
|
{
|
||||||
nameParts = args[0].split(":");
|
nameParts = args[0].split(":");
|
||||||
if (nameParts[0].length() == args[0].length())
|
if (nameParts[0].length() == args[0].length() || !user.isAuthorized("essentials.home.others"))
|
||||||
{
|
{
|
||||||
homeName = nameParts[0];
|
homeName = nameParts[0];
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,19 @@ public class Commandsethome extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
{
|
{
|
||||||
|
//Allowing both formats /sethome khobbits house | /sethome khobbits:house
|
||||||
|
final String[] nameParts = args[0].split(":");
|
||||||
|
if (nameParts[0].length() != args[0].length())
|
||||||
|
{
|
||||||
|
args = nameParts;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.length < 2)
|
if (args.length < 2)
|
||||||
{
|
{
|
||||||
if (user.isAuthorized("essentials.sethome.multiple"))
|
if (user.isAuthorized("essentials.sethome.multiple"))
|
||||||
{
|
{
|
||||||
if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getMultipleHomes())
|
if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getMultipleHomes())
|
||||||
|| (user.getHomes().contains(args[0].toLowerCase())))
|
|| (user.getHomes().contains(args[0].toLowerCase())))
|
||||||
{
|
{
|
||||||
user.setHome(args[0].toLowerCase());
|
user.setHome(args[0].toLowerCase());
|
||||||
}
|
}
|
||||||
@ -46,7 +53,12 @@ public class Commandsethome extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
throw new Exception(Util.i18n("playerNotFound"));
|
throw new Exception(Util.i18n("playerNotFound"));
|
||||||
}
|
}
|
||||||
usersHome.setHome(args[1].toLowerCase(), user.getLocation());
|
String name = args[1].toLowerCase();
|
||||||
|
if (!user.isAuthorized("essentials.sethome.multiple"))
|
||||||
|
{
|
||||||
|
name = "home";
|
||||||
|
}
|
||||||
|
usersHome.setHome(name, user.getLocation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user