diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java index bfca432bf..e10febc96 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java @@ -31,12 +31,12 @@ import com.intellectualcrafters.plot.events.PlayerPlotDeniedEvent; 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; -@SuppressWarnings("deprecation") public class Denied extends SubCommand { public Denied() { super(Command.DENIED, "Manage plot helpers", "denied {add|remove} {player}", CommandCategory.ACTIONS, true); @@ -87,18 +87,17 @@ public class Denied extends SubCommand { } plot.addDenied(uuid); DBFunc.setDenied(loc.getWorld(), plot, uuid); - final PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true); - Bukkit.getPluginManager().callEvent(event); + //FIXME PlayerPlotDeniedEvent } else { MainUtil.sendMessage(plr, C.ALREADY_ADDED); return false; } - final Player player = UUIDHandler.uuidWrapper.getPlayer(uuid); + final PlotPlayer player = UUIDHandler.getPlayer(uuid); if (!uuid.equals(DBFunc.everyone) && (player != null) && player.isOnline()) { final Plot pl = MainUtil.getPlot(loc); if ((pl != null) && pl.id.equals(plot.id)) { - MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.YOU_BE_DENIED); - player.teleport(player.getWorld().getSpawnLocation()); + MainUtil.sendMessage(player, C.YOU_BE_DENIED); + player.teleport(BlockManager.manager.getSpawn(loc.getWorld())); } } MainUtil.sendMessage(plr, C.DENIED_ADDED); @@ -118,8 +117,7 @@ public class Denied extends SubCommand { final UUID uuid = UUIDHandler.getUUID(args[1]); plot.removeDenied(uuid); DBFunc.removeDenied(loc.getWorld(), plot, uuid); - final PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, false); - Bukkit.getPluginManager().callEvent(event); + // FIXME PlayerPlotDeniedEvent MainUtil.sendMessage(plr, C.DENIED_REMOVED); } else { MainUtil.sendMessage(plr, C.DENIED_NEED_ARGUMENT); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java index df962c79a..272e25422 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java @@ -29,6 +29,8 @@ public abstract class BlockManager { return (int) r; } + public abstract Location getSpawn(String world); + public abstract String[] getSign(Location loc); public abstract boolean isWorld(String world); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java index 842cfd920..c3bb572d9 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java @@ -210,4 +210,10 @@ public class BukkitUtil extends BlockManager { } return null; } + + @Override + public Location getSpawn(String world) { + org.bukkit.Location temp = getWorld(world).getSpawnLocation(); + return new Location(world, temp.getBlockX(), temp.getBlockY(), temp.getBlockZ()); + } }