Catch TeleportClause.COMMAND in the teleport listener.

Changed Teleport methods to pass a TeleportClause param
This commit is contained in:
ementalo 2011-12-07 01:12:36 +00:00
parent 854fc05c5b
commit 10597cec2f
19 changed files with 69 additions and 49 deletions

View file

@ -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())
{