Merge pull request #441 from LaxWasHere/master

Don't TP players on clear
This commit is contained in:
Jesse Boyd 2015-07-23 01:20:13 +10:00
commit 5ec4c244d2

View File

@ -1,12 +1,21 @@
package com.intellectualcrafters.plot.util.bukkit; package com.intellectualcrafters.plot.util.bukkit;
import java.io.File; import com.intellectualcrafters.plot.BukkitMain;
import java.util.ArrayList; import com.intellectualcrafters.plot.PS;
import java.util.Arrays; import com.intellectualcrafters.plot.object.BlockLoc;
import java.util.HashMap; import com.intellectualcrafters.plot.object.ChunkLoc;
import java.util.HashSet; import com.intellectualcrafters.plot.object.Location;
import java.util.List; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.object.entity.EntityWrapper;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.SetBlockQueue.ChunkWrapper;
import com.intellectualcrafters.plot.util.TaskManager;
import org.apache.commons.lang.mutable.MutableInt; import org.apache.commons.lang.mutable.MutableInt;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Chunk; import org.bukkit.Chunk;
@ -44,22 +53,12 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import com.intellectualcrafters.plot.BukkitMain; import java.io.File;
import com.intellectualcrafters.plot.PS; import java.util.ArrayList;
import com.intellectualcrafters.plot.object.BlockLoc; import java.util.Arrays;
import com.intellectualcrafters.plot.object.ChunkLoc; import java.util.HashMap;
import com.intellectualcrafters.plot.object.Location; import java.util.HashSet;
import com.intellectualcrafters.plot.object.Plot; import java.util.List;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.object.entity.EntityWrapper;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.SetBlockQueue.ChunkWrapper;
import com.intellectualcrafters.plot.util.TaskManager;
public class BukkitChunkManager extends ChunkManager { public class BukkitChunkManager extends ChunkManager {
@Override @Override
@ -127,7 +126,7 @@ public class BukkitChunkManager extends ChunkManager {
} }
}); });
} }
@Override @Override
public void deleteRegionFiles(final String world, final List<ChunkLoc> chunks) { public void deleteRegionFiles(final String world, final List<ChunkLoc> chunks) {
TaskManager.runTaskAsync(new Runnable() { TaskManager.runTaskAsync(new Runnable() {
@ -877,7 +876,10 @@ public class BukkitChunkManager extends ChunkManager {
if (entity instanceof Player) { if (entity instanceof Player) {
final Player player = (Player) entity; final Player player = (Player) entity;
final PlotPlayer pp = BukkitUtil.getPlayer(player); final PlotPlayer pp = BukkitUtil.getPlayer(player);
pp.teleport(MainUtil.getDefaultHome(plot)); final Location plotHome = MainUtil.getDefaultHome(plot);
if (pp.getLocation().getY() <= plotHome.getY()) {
pp.teleport(plotHome);
}
} else { } else {
entity.remove(); entity.remove();
} }