mirror of
https://github.com/essentials/Essentials.git
synced 2025-01-17 21:39:26 +01:00
Split if tree for readability.
This commit is contained in:
parent
7f521ca4a2
commit
01cb84b627
@ -20,13 +20,24 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
|
||||
final User target = user.getTeleportRequest();
|
||||
|
||||
if (target == null || !target.isOnline()
|
||||
|| (args.length > 0 && !target.getName().contains(args[0]))
|
||||
|| (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
||||
|| (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
|
||||
|| (user.getWorld() != target.getWorld()
|
||||
&& ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + target.getWorld().getName())))))
|
||||
if (target == null || !target.isOnline())
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
if (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user