This commit is contained in:
Jesse Boyd 2015-01-16 22:25:54 -08:00
parent 101cd6b114
commit d958f57375
3 changed files with 10 additions and 6 deletions

View file

@ -575,10 +575,11 @@ import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
* @return true if successful
*/
public static boolean teleportPlayer(final Player player, final Location from, final Plot plot) {
final PlayerTeleportToPlotEvent event = new PlayerTeleportToPlotEvent(player, from, plot);
Plot bot = PlayerFunctions.getBottomPlot(player.getWorld(), plot);
final PlayerTeleportToPlotEvent event = new PlayerTeleportToPlotEvent(player, from, bot);
Bukkit.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
final Location location = PlotHelper.getPlotHome(Bukkit.getWorld(plot.world), plot);
final Location location = PlotHelper.getPlotHome(Bukkit.getWorld(bot.world), bot);
if ((location.getBlockX() >= 29999999) || (location.getBlockX() <= -29999999) || (location.getBlockZ() >= 299999999) || (location.getBlockZ() <= -29999999)) {
event.setCancelled(true);
return false;