mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Fixes #1585
This commit is contained in:
parent
a87fee1224
commit
3c110bb125
@ -14,6 +14,7 @@ import com.intellectualcrafters.plot.util.ByteArrayUtilities;
|
|||||||
import com.intellectualcrafters.plot.util.EconHandler;
|
import com.intellectualcrafters.plot.util.EconHandler;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.Permissions;
|
import com.intellectualcrafters.plot.util.Permissions;
|
||||||
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
@CommandDeclaration(command = "auto",
|
@CommandDeclaration(command = "auto",
|
||||||
@ -136,12 +137,17 @@ public class Auto extends SubCommand {
|
|||||||
final String finalSchematic = schematic;
|
final String finalSchematic = schematic;
|
||||||
autoClaimSafe(player, plotarea, null, new RunnableVal<Plot>() {
|
autoClaimSafe(player, plotarea, null, new RunnableVal<Plot>() {
|
||||||
@Override
|
@Override
|
||||||
public void run(Plot value) {
|
public void run(final Plot plot) {
|
||||||
if (value == null) {
|
TaskManager.IMP.sync(new RunnableVal<Object>() {
|
||||||
MainUtil.sendMessage(player, C.NO_FREE_PLOTS);
|
@Override
|
||||||
} else {
|
public void run(Object ignore) {
|
||||||
value.claim(player, true, finalSchematic, false);
|
if (value == null) {
|
||||||
}
|
MainUtil.sendMessage(player, C.NO_FREE_PLOTS);
|
||||||
|
} else {
|
||||||
|
plot.claim(player, true, finalSchematic, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
@ -8,9 +8,11 @@ import com.intellectualcrafters.plot.object.Location;
|
|||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.object.PlotArea;
|
import com.intellectualcrafters.plot.object.PlotArea;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
|
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||||
import com.intellectualcrafters.plot.util.ByteArrayUtilities;
|
import com.intellectualcrafters.plot.util.ByteArrayUtilities;
|
||||||
import com.intellectualcrafters.plot.util.EconHandler;
|
import com.intellectualcrafters.plot.util.EconHandler;
|
||||||
import com.intellectualcrafters.plot.util.Permissions;
|
import com.intellectualcrafters.plot.util.Permissions;
|
||||||
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
@CommandDeclaration(command = "claim",
|
@CommandDeclaration(command = "claim",
|
||||||
@ -88,7 +90,12 @@ public class Claim extends SubCommand {
|
|||||||
DBFunc.createPlotSafe(plot, new Runnable() {
|
DBFunc.createPlotSafe(plot, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
plot.claim(player, true, finalSchematic, false);
|
TaskManager.IMP.sync(new RunnableVal<Object>() {
|
||||||
|
@Override
|
||||||
|
public void run(Object value) {
|
||||||
|
plot.claim(player, true, finalSchematic, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, new Runnable() {
|
}, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -508,7 +508,9 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
|
|||||||
TaskManager.IMP.sync(new RunnableVal<Object>() {
|
TaskManager.IMP.sync(new RunnableVal<Object>() {
|
||||||
@Override
|
@Override
|
||||||
public void run(Object o) {
|
public void run(Object o) {
|
||||||
teleport(loc);
|
if (getMeta("teleportOnLogin", true)) {
|
||||||
|
teleport(loc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user