mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Fix radius logic
This commit is contained in:
parent
419f51636a
commit
ba6fd95247
1 changed files with 9 additions and 6 deletions
|
@ -19,12 +19,15 @@ public class Commandnear extends EssentialsCommand
|
||||||
@Override
|
@Override
|
||||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
long chatRadius = ess.getSettings().getChatRadius();
|
long maxRadius = ess.getSettings().getChatRadius();
|
||||||
long radius = chatRadius;
|
|
||||||
if (radius == 0)
|
if (maxRadius == 0)
|
||||||
{
|
{
|
||||||
radius = 200;
|
maxRadius = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long radius = maxRadius;
|
||||||
|
|
||||||
User otherUser = null;
|
User otherUser = null;
|
||||||
|
|
||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
|
@ -55,9 +58,9 @@ public class Commandnear extends EssentialsCommand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radius > chatRadius && !user.isAuthorized("essentials.near.exemptradius"))
|
if (radius > maxRadius && !user.isAuthorized("essentials.near.maxexempt"))
|
||||||
{
|
{
|
||||||
user.sendMessage(_("radiusTooBig", chatRadius));
|
user.sendMessage(_("radiusTooBig", maxRadius));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (otherUser == null || user.isAuthorized("essentials.near.others"))
|
if (otherUser == null || user.isAuthorized("essentials.near.others"))
|
||||||
|
|
Loading…
Reference in a new issue