Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Split if tree for readability.

  • Loading branch information...
commit 3e88fb44f47f8f17a0f496164255fbbff07bafc9 1 parent 518b013
KHobbits authored March 20, 2012
25  Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -20,13 +20,24 @@ public void run(final Server server, final User user, final String commandLabel,
20 20
 
21 21
 		final User target = user.getTeleportRequest();
22 22
 
23  
-		if (target == null || !target.isOnline()
24  
-			|| (args.length > 0 && !target.getName().contains(args[0]))
25  
-			|| (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
26  
-			|| (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
27  
-												  || (user.getWorld() != target.getWorld()
28  
-													  && ess.getSettings().isWorldTeleportPermissions()
29  
-													  && !user.isAuthorized("essentials.world." + target.getWorld().getName())))))
  23
+		if (target == null || !target.isOnline())
  24
+		{
  25
+			throw new Exception(_("noPendingRequest"));
  26
+		}
  27
+
  28
+		if (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
  29
+		{
  30
+			throw new Exception(_("noPendingRequest"));
  31
+		}
  32
+
  33
+		if (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
  34
+										|| (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions()
  35
+											&& !user.isAuthorized("essentials.world." + target.getWorld().getName()))))
  36
+		{
  37
+			throw new Exception(_("noPendingRequest"));
  38
+		}
  39
+
  40
+		if (args.length > 0 && !target.getName().contains(args[0]))
30 41
 		{
31 42
 			throw new Exception(_("noPendingRequest"));
32 43
 		}

0 notes on commit 3e88fb4

Please sign in to comment.
Something went wrong with that request. Please try again.