This commit is contained in:
Jesse Boyd 2017-04-18 22:54:51 +10:00
parent a87fee1224
commit 3c110bb125
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 23 additions and 8 deletions

View File

@ -14,6 +14,7 @@ import com.intellectualcrafters.plot.util.ByteArrayUtilities;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "auto",
@ -136,14 +137,19 @@ public class Auto extends SubCommand {
final String finalSchematic = schematic;
autoClaimSafe(player, plotarea, null, new RunnableVal<Plot>() {
@Override
public void run(Plot value) {
public void run(final Plot plot) {
TaskManager.IMP.sync(new RunnableVal<Object>() {
@Override
public void run(Object ignore) {
if (value == null) {
MainUtil.sendMessage(player, C.NO_FREE_PLOTS);
} else {
value.claim(player, true, finalSchematic, false);
plot.claim(player, true, finalSchematic, false);
}
}
});
}
});
return true;
} else {
if (plotarea.TYPE == 2) {

View File

@ -8,9 +8,11 @@ import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.ByteArrayUtilities;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "claim",
@ -88,8 +90,13 @@ public class Claim extends SubCommand {
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);
}
});
}
}, new Runnable() {
@Override
public void run() {

View File

@ -508,8 +508,10 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
TaskManager.IMP.sync(new RunnableVal<Object>() {
@Override
public void run(Object o) {
if (getMeta("teleportOnLogin", true)) {
teleport(loc);
}
}
});
}
}