mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-22 21:43:41 +00:00
Catch TeleportClause.COMMAND in the teleport listener.
Changed Teleport methods to pass a TeleportClause param
This commit is contained in:
parent
854fc05c5b
commit
10597cec2f
19 changed files with 69 additions and 49 deletions
|
@ -5,6 +5,7 @@ import com.earth2me.essentials.OfflinePlayer;
|
|||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpaccept extends EssentialsCommand
|
||||
|
@ -40,11 +41,11 @@ public class Commandtpaccept extends EssentialsCommand
|
|||
|
||||
if (user.isTeleportRequestHere())
|
||||
{
|
||||
user.getTeleport().teleport(target, charge);
|
||||
user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.getTeleport().teleport(user, charge);
|
||||
target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
user.requestTeleport(null, false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue