City is a nub

This commit is contained in:
boy0001
2015-07-24 03:14:36 +10:00
parent d09dbee3c7
commit 57c849cbaa
9 changed files with 358 additions and 178 deletions

View File

@ -124,7 +124,6 @@ public class DebugClaimTest extends SubCommand {
if (uuid != null) {
MainUtil.sendMessage(null, " - &aFound plot: " + plot.id + " : " + line);
plot.owner = uuid;
plot.hasChanged = true;
plots.add(plot);
} else {
MainUtil.sendMessage(null, " - &cInvalid playername: " + plot.id + " : " + line);

View File

@ -44,7 +44,7 @@ public class Download extends SubCommand {
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
URL url = SchematicHandler.manager.upload(value);
URL url = SchematicHandler.manager.upload(value, null);
if (url == null) {
MainUtil.sendMessage(plr, C.GENERATING_LINK_FAILED);
MainUtil.runners.remove(plot);

View File

@ -20,12 +20,16 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.UUID;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
@ -84,13 +88,30 @@ public class SchematicCmd extends SubCommand {
MainUtil.sendMessage(plr, "&cTask is already running.");
return false;
}
final String file2 = args[1];
final String location = args[1];
this.running = true;
this.counter = 0;
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
final Schematic schematic = SchematicHandler.manager.getSchematic(file2);
Schematic schematic;
if (location.startsWith("url:")) {
try {
UUID uuid = UUID.fromString(location.substring(4));
URL base = new URL(Settings.WEB_URL);
URL url = new URL(base, "uploads/" + uuid + ".schematic");
schematic = SchematicHandler.manager.getSchematic(url);
}
catch (Exception e) {
e.printStackTrace();
sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent url: " + location);
SchematicCmd.this.running = false;
return;
}
}
else {
schematic = SchematicHandler.manager.getSchematic(location);
}
if (schematic == null) {
SchematicCmd.this.running = false;
sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent or not in gzip format");