Multiple changes

Working on async schematic saving
Default plot clearing is now properly async (and somewhat slower)
Offline mode servers now default to lowercase (there has been ample time
to update)
Fixed some issues with plot expiry
Fixed some issues with UUID caching
Optimized UUID fetching from cache (marginal)
This commit is contained in:
boy0001
2015-07-19 23:12:48 +10:00
parent 404933c3a7
commit 9c635810b0
14 changed files with 210 additions and 140 deletions

View File

@ -45,7 +45,7 @@ public class CreateRoadSchematic extends SubCommand {
return sendMessage(player, C.NOT_IN_PLOT_WORLD);
}
HybridUtils.manager.setupRoadSchematic(plot);
MainUtil.sendMessage(player, "&6Saved new road schematic");
MainUtil.sendMessage(player, "&6Saved new road schematic (see console for more information)");
return true;
}
}

View File

@ -74,6 +74,7 @@ public class DebugExec extends SubCommand {
PlotAnalysis analysis = plot.getComplexity();
if (analysis != null) {
int complexity = analysis.getComplexity();
MainUtil.sendMessage(player, "Changes: " + analysis.changes);
MainUtil.sendMessage(player, "Complexity: " + complexity);
return true;
}

View File

@ -8,6 +8,7 @@ import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.TaskManager;
@ -37,17 +38,22 @@ public class Download extends SubCommand {
}
MainUtil.runners.put(plot, 1);
MainUtil.sendMessage(plr, C.GENERATING_LINK);
final CompoundTag tag = SchematicHandler.manager.getCompoundTag(plot.world, plot.id);
TaskManager.runTaskAsync(new Runnable() {
SchematicHandler.manager.getCompoundTag(plot.world, plot.id, new RunnableVal<CompoundTag>() {
@Override
public void run() {
URL url = SchematicHandler.manager.upload(tag);
if (url == null) {
MainUtil.sendMessage(plr, C.GENERATING_LINK_FAILED);
return;
}
MainUtil.sendMessage(plr, url.toString());
MainUtil.runners.remove(plot);
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
URL url = SchematicHandler.manager.upload(value);
if (url == null) {
MainUtil.sendMessage(plr, C.GENERATING_LINK_FAILED);
MainUtil.runners.remove(plot);
return;
}
MainUtil.sendMessage(plr, url.toString());
MainUtil.runners.remove(plot);
}
});
}
});
return true;