This commit is contained in:
boy0001 2015-07-22 16:28:11 +10:00
parent 95ad199f52
commit 7cedc3befe
2 changed files with 8 additions and 10 deletions

View File

@ -28,11 +28,13 @@ import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.BlockManager;
import com.intellectualcrafters.plot.util.EventUtil; import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.bukkit.BukkitUtil; import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -91,15 +93,10 @@ public class Deny extends SubCommand {
} }
private void handleKick(final UUID uuid, final Plot plot) { private void handleKick(final UUID uuid, final Plot plot) {
Player p = Bukkit.getPlayer(uuid); PlotPlayer pp = UUIDHandler.getPlayer(uuid);
if (p != null && p.isOnline()) { if (pp != null && plot.equals(MainUtil.getPlot(pp.getLocation()))) {
if (PS.get().isPlotWorld(p.getWorld().getName())) { pp.teleport(BlockManager.manager.getSpawn(pp.getLocation().getWorld()));
Plot pl = MainUtil.getPlot(BukkitUtil.getLocation(p)); MainUtil.sendMessage(pp, C.YOU_GOT_DENIED);
if (pl != null && pl.equals(plot)) {
p.teleport(p.getWorld().getSpawnLocation());
MainUtil.sendMessage(BukkitUtil.getPlayer(p), C.YOU_GOT_DENIED);
}
}
} }
} }
} }

View File

@ -447,8 +447,9 @@ public abstract class SchematicHandler {
public void getCompoundTag(final String world, final PlotId id, RunnableVal<CompoundTag> whenDone) { public void getCompoundTag(final String world, final PlotId id, RunnableVal<CompoundTag> whenDone) {
if (!PS.get().getPlots(world).containsKey(id)) { if (!PS.get().getPlots(world).containsKey(id)) {
whenDone.run(); whenDone.run();
return;
} }
final Location pos1 = MainUtil.getPlotBottomLoc(world, id).add(1, 0, 1); final Location pos1 = MainUtil.getPlotBottomLoc(world, id).add(1, -1, 1);
final Location pos2 = MainUtil.getPlotTopLoc(world, id); final Location pos2 = MainUtil.getPlotTopLoc(world, id);
getCompoundTag(world, pos1, pos2, whenDone); getCompoundTag(world, pos1, pos2, whenDone);
} }