This commit is contained in:
boy0001 2015-02-22 01:13:34 +11:00
parent 694dd0432e
commit d7d012a39d
5 changed files with 18 additions and 14 deletions

View File

@ -50,14 +50,18 @@ public class Claim extends SubCommand {
if (plot.hasOwner() || plot.settings.isMerged()) { if (plot.hasOwner() || plot.settings.isMerged()) {
return false; return false;
} }
final PlayerClaimPlotEvent event = new PlayerClaimPlotEvent(player, plot, auto); // FIXME claim plot event
Bukkit.getPluginManager().callEvent(event); // final PlayerClaimPlotEvent event = new PlayerClaimPlotEvent(player, plot, auto);
if (!event.isCancelled()) { // Bukkit.getPluginManager().callEvent(event);
MainUtil.createPlot(player, plot); // boolean result = event.isCancelled();
MainUtil.setSign(player, plot); boolean result = true;
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.CLAIMED);
if (!result) {
MainUtil.createPlot(player.getUUID(), plot);
MainUtil.setSign(player.getName(), plot);
MainUtil.sendMessage(player, C.CLAIMED);
if (teleport) { if (teleport) {
PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); MainUtil.teleportPlayer(player, player.getLocation(), plot);
} }
final World world = plot.world; final World world = plot.world;
final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotWorld plotworld = PlotSquared.getPlotWorld(world);

View File

@ -67,7 +67,7 @@ public class DebugClaimTest extends SubCommand {
MainUtil.setSign(player, plot); MainUtil.setSign(player, plot);
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.CLAIMED); MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.CLAIMED);
if (teleport) { if (teleport) {
PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); MainUtil.teleportPlayer(player, player.getLocation(), plot);
} }
} }
return event.isCancelled(); return event.isCancelled();

View File

@ -50,7 +50,7 @@ public class Home extends SubCommand {
public boolean execute(final PlotPlayer plr, String... args) { public boolean execute(final PlotPlayer plr, String... args) {
final Plot[] plots = PlotSquared.getPlots(plr).toArray(new Plot[0]); final Plot[] plots = PlotSquared.getPlots(plr).toArray(new Plot[0]);
if (plots.length == 1) { if (plots.length == 1) {
PlotSquared.teleportPlayer(plr, plr.getLocation(), plots[0]); MainUtil.teleportPlayer(plr, plr.getLocation(), plots[0]);
return true; return true;
} else if (plots.length > 1) { } else if (plots.length > 1) {
if (args.length < 1) { if (args.length < 1) {
@ -87,6 +87,6 @@ public class Home extends SubCommand {
} }
public void teleportPlayer(final Player player, final Plot plot) { public void teleportPlayer(final Player player, final Plot plot) {
PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); MainUtil.teleportPlayer(player, player.getLocation(), plot);
} }
} }

View File

@ -60,12 +60,12 @@ public class TP extends SubCommand {
} }
Plot temp; Plot temp;
if ((temp = isAlias(world, id)) != null) { if ((temp = isAlias(world, id)) != null) {
PlotSquared.teleportPlayer(plr, plr.getLocation(), temp); MainUtil.teleportPlayer(plr, plr.getLocation(), temp);
return true; return true;
} }
try { try {
plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1])); 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; return true;
} catch (final Exception e) { } catch (final Exception e) {
MainUtil.sendMessage(plr, C.NOT_VALID_PLOT_ID); MainUtil.sendMessage(plr, C.NOT_VALID_PLOT_ID);

View File

@ -60,7 +60,7 @@ public class Visit extends SubCommand {
return sendMessage(plr, C.FOUND_NO_PLOTS); return sendMessage(plr, C.FOUND_NO_PLOTS);
} }
if (args.length < 2) { if (args.length < 2) {
PlotSquared.teleportPlayer(plr, plr.getLocation(), plots.get(0)); MainUtil.teleportPlayer(plr, plr.getLocation(), plots.get(0));
return true; return true;
} }
int i; int i;
@ -72,7 +72,7 @@ public class Visit extends SubCommand {
if ((i < 0) || (i >= plots.size())) { if ((i < 0) || (i >= plots.size())) {
return sendMessage(plr, C.NOT_VALID_NUMBER); 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; return true;
} }
} }