Small tweaks

Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
This commit is contained in:
matt 2019-02-06 17:30:25 -05:00
parent 9101cb9218
commit 3d8179a4e6
2 changed files with 9 additions and 21 deletions

View File

@ -11,9 +11,7 @@ import com.github.intellectualsites.plotsquared.plot.util.*;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.Set; import java.util.Set;
@CommandDeclaration(command = "auto", permission = "plots.auto", @CommandDeclaration(command = "auto", permission = "plots.auto", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]")
category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE,
description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]")
public class Auto extends SubCommand { public class Auto extends SubCommand {
@Deprecated public static PlotId getNextPlotId(PlotId id, int step) { @Deprecated public static PlotId getNextPlotId(PlotId id, int step) {

View File

@ -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.Permissions;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
@CommandDeclaration(command = "claim", aliases = "c", @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")
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 { public class Claim extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) { @Override public boolean onCommand(final PlotPlayer player, String[] args) {
@ -82,22 +80,14 @@ public class Claim extends SubCommand {
if (plot.canClaim(player)) { if (plot.canClaim(player)) {
plot.owner = player.getUUID(); plot.owner = player.getUUID();
final String finalSchematic = schematic; final String finalSchematic = schematic;
DBFunc.createPlotSafe(plot, new Runnable() { DBFunc.createPlotSafe(plot, () -> TaskManager.IMP.sync(new RunnableVal<Object>() {
@Override public void run() {
TaskManager.IMP.sync(new RunnableVal<Object>() {
@Override public void run(Object value) { @Override public void run(Object value) {
plot.claim(player, true, finalSchematic, false); plot.claim(player, true, finalSchematic, false);
if (area.AUTO_MERGE) { if (area.AUTO_MERGE) {
plot.autoMerge(-1, Integer.MAX_VALUE, player.getUUID(), true); plot.autoMerge(-1, Integer.MAX_VALUE, player.getUUID(), true);
} }
} }
}); }), () -> sendMessage(player, C.PLOT_NOT_CLAIMED));
}
}, new Runnable() {
@Override public void run() {
sendMessage(player, C.PLOT_NOT_CLAIMED);
}
});
return true; return true;
} else { } else {
sendMessage(player, C.PLOT_NOT_CLAIMED); sendMessage(player, C.PLOT_NOT_CLAIMED);