mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 16:46:45 +01:00
Only re-teleport players if stuck after chunk has regenerated
This commit is contained in:
parent
3f04c34d6e
commit
97d4e29010
@ -98,10 +98,10 @@ public class BukkitChunkManager extends ChunkManager {
|
|||||||
public void regenerateChunk(String world, ChunkLoc loc) {
|
public void regenerateChunk(String world, ChunkLoc loc) {
|
||||||
World worldObj = Bukkit.getWorld(world);
|
World worldObj = Bukkit.getWorld(world);
|
||||||
worldObj.regenerateChunk(loc.x, loc.z);
|
worldObj.regenerateChunk(loc.x, loc.z);
|
||||||
for (final Player player : Bukkit.getOnlinePlayers()) {
|
for (final Player player : worldObj.getPlayers()) {
|
||||||
Location playerLoc = BukkitUtil.getLocation(player.getLocation());
|
org.bukkit.Location locObj = player.getLocation();
|
||||||
if (playerLoc.getX() >> 4 == loc.x && playerLoc.getZ() >> 4 == loc.z) {
|
if (locObj.getBlockX() >> 4 == loc.x && locObj.getBlockZ() >> 4 == loc.z && !locObj.getBlock().isEmpty()) {
|
||||||
final Plot plot = MainUtil.getPlot(playerLoc);
|
final Plot plot = MainUtil.getPlot(BukkitUtil.getLocation(locObj));
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
final PlotPlayer pp = BukkitUtil.getPlayer(player);
|
final PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||||
pp.teleport(MainUtil.getDefaultHome(plot));
|
pp.teleport(MainUtil.getDefaultHome(plot));
|
||||||
|
Loading…
Reference in New Issue
Block a user