diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java index e9f74ba69..49fbe1e03 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java @@ -50,14 +50,18 @@ public class Claim extends SubCommand { if (plot.hasOwner() || plot.settings.isMerged()) { return false; } - final PlayerClaimPlotEvent event = new PlayerClaimPlotEvent(player, plot, auto); - Bukkit.getPluginManager().callEvent(event); - if (!event.isCancelled()) { - MainUtil.createPlot(player, plot); - MainUtil.setSign(player, plot); - MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.CLAIMED); + // FIXME claim plot event +// final PlayerClaimPlotEvent event = new PlayerClaimPlotEvent(player, plot, auto); +// Bukkit.getPluginManager().callEvent(event); +// boolean result = event.isCancelled(); + boolean result = true; + + if (!result) { + MainUtil.createPlot(player.getUUID(), plot); + MainUtil.setSign(player.getName(), plot); + MainUtil.sendMessage(player, C.CLAIMED); if (teleport) { - PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); + MainUtil.teleportPlayer(player, player.getLocation(), plot); } final World world = plot.world; final PlotWorld plotworld = PlotSquared.getPlotWorld(world); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java index 699a1ad8d..a09fe55e3 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java @@ -67,7 +67,7 @@ public class DebugClaimTest extends SubCommand { MainUtil.setSign(player, plot); MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.CLAIMED); if (teleport) { - PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); + MainUtil.teleportPlayer(player, player.getLocation(), plot); } } return event.isCancelled(); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java index 3aaf74b5c..d9d922c04 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java @@ -50,7 +50,7 @@ public class Home extends SubCommand { public boolean execute(final PlotPlayer plr, String... args) { final Plot[] plots = PlotSquared.getPlots(plr).toArray(new Plot[0]); if (plots.length == 1) { - PlotSquared.teleportPlayer(plr, plr.getLocation(), plots[0]); + MainUtil.teleportPlayer(plr, plr.getLocation(), plots[0]); return true; } else if (plots.length > 1) { if (args.length < 1) { @@ -87,6 +87,6 @@ public class Home extends SubCommand { } public void teleportPlayer(final Player player, final Plot plot) { - PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); + MainUtil.teleportPlayer(player, player.getLocation(), plot); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/TP.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/TP.java index 097d61e50..7755edf82 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/TP.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/TP.java @@ -60,12 +60,12 @@ public class TP extends SubCommand { } Plot temp; if ((temp = isAlias(world, id)) != null) { - PlotSquared.teleportPlayer(plr, plr.getLocation(), temp); + MainUtil.teleportPlayer(plr, plr.getLocation(), temp); return true; } try { plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1])); - PlotSquared.teleportPlayer(plr, plr.getLocation(), MainUtil.getPlot(world, plotid)); + MainUtil.teleportPlayer(plr, plr.getLocation(), MainUtil.getPlot(world, plotid)); return true; } catch (final Exception e) { MainUtil.sendMessage(plr, C.NOT_VALID_PLOT_ID); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Visit.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Visit.java index 2d997d34e..2e2d82df6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Visit.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Visit.java @@ -60,7 +60,7 @@ public class Visit extends SubCommand { return sendMessage(plr, C.FOUND_NO_PLOTS); } if (args.length < 2) { - PlotSquared.teleportPlayer(plr, plr.getLocation(), plots.get(0)); + MainUtil.teleportPlayer(plr, plr.getLocation(), plots.get(0)); return true; } int i; @@ -72,7 +72,7 @@ public class Visit extends SubCommand { if ((i < 0) || (i >= plots.size())) { return sendMessage(plr, C.NOT_VALID_NUMBER); } - PlotSquared.teleportPlayer(plr, plr.getLocation(), plots.get(i)); + MainUtil.teleportPlayer(plr, plr.getLocation(), plots.get(i)); return true; } }