mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 20:43:11 +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
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandhome extends EssentialsCommand
|
||||
|
@ -48,7 +49,7 @@ public class Commandhome extends EssentialsCommand
|
|||
final Location bed = player.getBedSpawnLocation();
|
||||
if (bed != null)
|
||||
{
|
||||
user.getTeleport().teleport(bed, charge);
|
||||
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +60,7 @@ public class Commandhome extends EssentialsCommand
|
|||
final List<String> homes = player.getHomes();
|
||||
if (homes.isEmpty() && player.equals(user))
|
||||
{
|
||||
user.getTeleport().respawn(charge);
|
||||
user.getTeleport().respawn(charge, TeleportCause.COMMAND);
|
||||
}
|
||||
else if (homes.isEmpty())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue