From 97d4e29010b0fcd3c131610579f3145fe5fb29ec Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 9 Jun 2015 18:46:36 -0700 Subject: [PATCH] Only re-teleport players if stuck after chunk has regenerated --- .../plot/util/bukkit/BukkitChunkManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java index baf42380a..82da9abd7 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java @@ -98,10 +98,10 @@ public class BukkitChunkManager extends ChunkManager { public void regenerateChunk(String world, ChunkLoc loc) { World worldObj = Bukkit.getWorld(world); worldObj.regenerateChunk(loc.x, loc.z); - for (final Player player : Bukkit.getOnlinePlayers()) { - Location playerLoc = BukkitUtil.getLocation(player.getLocation()); - if (playerLoc.getX() >> 4 == loc.x && playerLoc.getZ() >> 4 == loc.z) { - final Plot plot = MainUtil.getPlot(playerLoc); + for (final Player player : worldObj.getPlayers()) { + org.bukkit.Location locObj = player.getLocation(); + if (locObj.getBlockX() >> 4 == loc.x && locObj.getBlockZ() >> 4 == loc.z && !locObj.getBlock().isEmpty()) { + final Plot plot = MainUtil.getPlot(BukkitUtil.getLocation(locObj)); if (plot != null) { final PlotPlayer pp = BukkitUtil.getPlayer(player); pp.teleport(MainUtil.getDefaultHome(plot));