From 3d8179a4e6a327f20fc0564e55d4b84b8f12b35f Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Wed, 6 Feb 2019 17:30:25 -0500 Subject: [PATCH] Small tweaks Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com> --- .../plotsquared/plot/commands/Auto.java | 4 +-- .../plotsquared/plot/commands/Claim.java | 26 ++++++------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java index 5035c1480..da71e8912 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java @@ -11,9 +11,7 @@ import com.github.intellectualsites.plotsquared.plot.util.*; import javax.annotation.Nullable; import java.util.Set; -@CommandDeclaration(command = "auto", permission = "plots.auto", - category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, - description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]") +@CommandDeclaration(command = "auto", permission = "plots.auto", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]") public class Auto extends SubCommand { @Deprecated public static PlotId getNextPlotId(PlotId id, int step) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java index 88f102967..ce7ee4c26 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java @@ -10,9 +10,7 @@ import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; -@CommandDeclaration(command = "claim", aliases = "c", - description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING, - requiredType = RequiredType.NONE, permission = "plots.claim", usage = "/plot claim") +@CommandDeclaration(command = "claim", aliases = "c", description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, permission = "plots.claim", usage = "/plot claim") public class Claim extends SubCommand { @Override public boolean onCommand(final PlotPlayer player, String[] args) { @@ -82,22 +80,14 @@ public class Claim extends SubCommand { if (plot.canClaim(player)) { plot.owner = player.getUUID(); final String finalSchematic = schematic; - DBFunc.createPlotSafe(plot, new Runnable() { - @Override public void run() { - TaskManager.IMP.sync(new RunnableVal() { - @Override public void run(Object value) { - plot.claim(player, true, finalSchematic, false); - if (area.AUTO_MERGE) { - plot.autoMerge(-1, Integer.MAX_VALUE, player.getUUID(), true); - } - } - }); + DBFunc.createPlotSafe(plot, () -> TaskManager.IMP.sync(new RunnableVal() { + @Override public void run(Object value) { + plot.claim(player, true, finalSchematic, false); + if (area.AUTO_MERGE) { + plot.autoMerge(-1, Integer.MAX_VALUE, player.getUUID(), true); + } } - }, new Runnable() { - @Override public void run() { - sendMessage(player, C.PLOT_NOT_CLAIMED); - } - }); + }), () -> sendMessage(player, C.PLOT_NOT_CLAIMED)); return true; } else { sendMessage(player, C.PLOT_NOT_CLAIMED);