mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-08-06 20:42:55 +00:00
Fixes #93
This commit is contained in:
parent
101cd6b114
commit
d958f57375
3 changed files with 10 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue