mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Small tweaks
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
This commit is contained in:
parent
9101cb9218
commit
3d8179a4e6
2 changed files with 9 additions and 21 deletions
|
@ -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) {
|
||||
|
|
|
@ -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<Object>() {
|
||||
@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<Object>() {
|
||||
@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);
|
||||
|
|
Loading…
Reference in a new issue