From caafd524e2f98709b1eef9d01592e2921e5a0b68 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 22 Feb 2015 18:17:13 +1100 Subject: [PATCH] kick --- .../intellectualcrafters/plot/commands/Kick.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java index 5c7850a95..e2228c6c1 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java @@ -20,14 +20,13 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// package com.intellectualcrafters.plot.commands; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - import com.intellectualcrafters.plot.config.C; 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.MainUtil; +import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.bukkit.BukkitPlayerFunctions; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; @@ -52,16 +51,16 @@ public class Kick extends SubCommand { MainUtil.sendMessage(plr, "&c/plot kick "); return false; } - if (Bukkit.getPlayer(args[0]) == null) { + PlotPlayer player = UUIDHandler.getPlayer(args[0]); + if (player == null) { MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]); return false; } - final Player player = Bukkit.getPlayer(args[0]); - if (!player.getWorld().equals(plr.getWorld()) || !BukkitPlayerFunctions.isInPlot(player) || (MainUtil.getPlot(loc) == null) || !MainUtil.getPlot(loc).equals(plot)) { + if (!player.getLocation().getWorld().equals(loc.getWorld()) || !plot.equals(MainUtil.getPlot(loc))) { MainUtil.sendMessage(plr, C.INVALID_PLAYER.s().replaceAll("%player%", args[0])); return false; } - player.teleport(player.getWorld().getSpawnLocation()); + player.teleport(BlockManager.manager.getSpawn(loc.getWorld())); return true; } }