summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-20 14:32:11 +0000
committerKHobbits <rob@khobbits.co.uk>2012-03-20 15:03:53 +0000
commit01cb84b627fbe3878aaa356ff743825f9227d307 (patch)
treef69e9efa1745b1a26a6edb056235d10910179f35
parent7f521ca4a299f09c43ca2b152cf8442952b43891 (diff)
downloadEssentials-01cb84b627fbe3878aaa356ff743825f9227d307.tar
Essentials-01cb84b627fbe3878aaa356ff743825f9227d307.tar.gz
Essentials-01cb84b627fbe3878aaa356ff743825f9227d307.tar.lz
Essentials-01cb84b627fbe3878aaa356ff743825f9227d307.tar.xz
Essentials-01cb84b627fbe3878aaa356ff743825f9227d307.zip
Split if tree for readability.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index ffc8f2fdd..7f06602ae 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -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"));
}