Update sponge port

This commit is contained in:
Jesse Boyd
2016-03-27 06:47:34 +11:00
parent 056f77a3ba
commit 46d3dc609e
6 changed files with 44 additions and 63 deletions

View File

@ -1465,13 +1465,16 @@ public class PS {
}
for (String areaId : areasSection.getKeys(false)) {
log(C.PREFIX + "&3 - " + areaId);
String[] split = areaId.split("([^\\-]+)(?:-{1})(-{0,1}\\d+\\;-{0,1}\\d+)(?:-{1})(-{0,1}\\d+\\;-{0,1}\\d+)");
if (split.length != 3) {
int i1 = areaId.indexOf("-");
int i2 = areaId.indexOf(";");
if (i1 == -1 || i2 == -1) {
throw new IllegalArgumentException("Invalid Area identifier: " + areaId + ". Expected form `<name>-<pos1>-<pos2>`");
}
String name = split[0];
PlotId pos1 = PlotId.fromString(split[1]);
PlotId pos2 = PlotId.fromString(split[2]);
String name = areaId.substring(0, i1);
String rest = areaId.substring(i1 + 1);
int i3 = rest.indexOf("-", i2);
PlotId pos1 = PlotId.fromString(rest.substring(0, i3));
PlotId pos2 = PlotId.fromString(rest.substring(i3 + 1));
if (pos1 == null || pos2 == null || name.isEmpty()) {
throw new IllegalArgumentException("Invalid Area identifier: " + areaId + ". Expected form `<name>-<x1;z1>-<x2;z2>`");
}

View File

@ -174,6 +174,9 @@ public class Trim extends SubCommand {
public void run(Set<ChunkLoc> viable, final Set<ChunkLoc> nonViable) {
Runnable regenTask;
if (regen) {
PS.log("Starting regen task:");
PS.log(" - This is a VERY slow command");
PS.log(" - It will say `Trim done!` when complete");
regenTask = new Runnable() {
@Override
public void run() {