mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Warn other party when teleport fails after tpaccept.
This commit is contained in:
parent
b2d68fe213
commit
8f00aa5542
1 changed files with 13 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
package com.earth2me.essentials.commands;
|
package com.earth2me.essentials.commands;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.ChargeException;
|
||||||
import static com.earth2me.essentials.I18n._;
|
import static com.earth2me.essentials.I18n._;
|
||||||
import com.earth2me.essentials.Trade;
|
import com.earth2me.essentials.Trade;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
|
@ -55,6 +56,8 @@ public class Commandtpaccept extends EssentialsCommand
|
||||||
user.sendMessage(_("requestAccepted"));
|
user.sendMessage(_("requestAccepted"));
|
||||||
target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
|
target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
if (user.isTpRequestHere())
|
if (user.isTpRequestHere())
|
||||||
{
|
{
|
||||||
target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
|
target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
|
||||||
|
@ -63,6 +66,12 @@ public class Commandtpaccept extends EssentialsCommand
|
||||||
{
|
{
|
||||||
target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
|
target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (ChargeException ex)
|
||||||
|
{
|
||||||
|
user.sendMessage(_("pendingTeleportCancelled"));
|
||||||
|
ess.showError(target, ex, commandLabel);
|
||||||
|
}
|
||||||
user.requestTeleport(null, false);
|
user.requestTeleport(null, false);
|
||||||
throw new NoChargeException();
|
throw new NoChargeException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue