Refactoring tpaccept perm check to include tpaall.

This commit is contained in:
KHobbits 2012-02-11 20:10:19 +00:00
parent de1554cb68
commit b0d06ce6ed

View File

@ -22,7 +22,9 @@ public class Commandtpaccept extends EssentialsCommand
final User target = user.getTeleportRequest();
if (target == null
|| target.getBase() instanceof OfflinePlayer
|| (user.isTeleportRequestHere() ? !target.isAuthorized("essentials.tpahere") : !target.isAuthorized("essentials.tpa")))
|| (user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpahere"))
|| (!user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
)
{
throw new Exception(_("noPendingRequest"));
}