mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 12:23:59 +00:00
Split if tree for readability.
This commit is contained in:
parent
518b013a63
commit
3e88fb44f4
1 changed files with 18 additions and 7 deletions
|
@ -20,13 +20,24 @@ public class Commandtpaccept extends EssentialsCommand
|
||||||
|
|
||||||
final User target = user.getTeleportRequest();
|
final User target = user.getTeleportRequest();
|
||||||
|
|
||||||
if (target == null || !target.isOnline()
|
if (target == null || !target.isOnline())
|
||||||
|| (args.length > 0 && !target.getName().contains(args[0]))
|
{
|
||||||
|| (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
throw new Exception(_("noPendingRequest"));
|
||||||
|| (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
|
}
|
||||||
|| (user.getWorld() != target.getWorld()
|
|
||||||
&& ess.getSettings().isWorldTeleportPermissions()
|
if (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
||||||
&& !user.isAuthorized("essentials.world." + target.getWorld().getName())))))
|
{
|
||||||
|
throw new Exception(_("noPendingRequest"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
|
||||||
|
|| (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||||
|
&& !user.isAuthorized("essentials.world." + target.getWorld().getName()))))
|
||||||
|
{
|
||||||
|
throw new Exception(_("noPendingRequest"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.length > 0 && !target.getName().contains(args[0]))
|
||||||
{
|
{
|
||||||
throw new Exception(_("noPendingRequest"));
|
throw new Exception(_("noPendingRequest"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue