From 7cedc3befeba7830efae2155fc82c539c388be6a Mon Sep 17 00:00:00 2001 From: boy0001 Date: Wed, 22 Jul 2015 16:28:11 +1000 Subject: [PATCH] Fixes #438 --- .../intellectualcrafters/plot/commands/Deny.java | 15 ++++++--------- .../plot/util/SchematicHandler.java | 3 ++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Deny.java b/src/main/java/com/intellectualcrafters/plot/commands/Deny.java index 4d0433362..d8230bbbf 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Deny.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Deny.java @@ -28,11 +28,13 @@ import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer; +import com.intellectualcrafters.plot.util.BlockManager; import com.intellectualcrafters.plot.util.EventUtil; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.bukkit.BukkitUtil; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; + import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -91,15 +93,10 @@ public class Deny extends SubCommand { } private void handleKick(final UUID uuid, final Plot plot) { - Player p = Bukkit.getPlayer(uuid); - if (p != null && p.isOnline()) { - if (PS.get().isPlotWorld(p.getWorld().getName())) { - Plot pl = MainUtil.getPlot(BukkitUtil.getLocation(p)); - if (pl != null && pl.equals(plot)) { - p.teleport(p.getWorld().getSpawnLocation()); - MainUtil.sendMessage(BukkitUtil.getPlayer(p), C.YOU_GOT_DENIED); - } - } + PlotPlayer pp = UUIDHandler.getPlayer(uuid); + if (pp != null && plot.equals(MainUtil.getPlot(pp.getLocation()))) { + pp.teleport(BlockManager.manager.getSpawn(pp.getLocation().getWorld())); + MainUtil.sendMessage(pp, C.YOU_GOT_DENIED); } } } diff --git a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java index c9084fd9a..3c7ece164 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java +++ b/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java @@ -447,8 +447,9 @@ public abstract class SchematicHandler { public void getCompoundTag(final String world, final PlotId id, RunnableVal whenDone) { if (!PS.get().getPlots(world).containsKey(id)) { 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); getCompoundTag(world, pos1, pos2, whenDone); }