mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-26 15:33:56 +00:00
Teleport check cleanup
This commit is contained in:
parent
e752538568
commit
518b013a63
8 changed files with 18 additions and 20 deletions
|
@ -19,16 +19,14 @@ public class Commandtpaccept extends EssentialsCommand
|
|||
{
|
||||
|
||||
final User target = user.getTeleportRequest();
|
||||
if (target == null
|
||||
|| !target.isOnline()
|
||||
|| (user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
||||
|| (!user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
|
||||
)
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
if (args.length > 0 && !target.getName().contains(args[0]))
|
||||
|
||||
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())))))
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
@ -41,7 +39,7 @@ public class Commandtpaccept extends EssentialsCommand
|
|||
}
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
if (user.isTeleportRequestHere())
|
||||
if (user.isTpRequestHere())
|
||||
{
|
||||
charge.isAffordableFor(user);
|
||||
}
|
||||
|
@ -52,7 +50,7 @@ public class Commandtpaccept extends EssentialsCommand
|
|||
user.sendMessage(_("requestAccepted"));
|
||||
target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
|
||||
|
||||
if (user.isTeleportRequestHere())
|
||||
if (user.isTpRequestHere())
|
||||
{
|
||||
user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue