Optimizations to schematic loading / pasting -> ~10,000,000 bps

The downside is it completely ignores entities and such, so WorldEdit is
the way to go if you need precision but don't care for large sizes or
speed.
This commit is contained in:
boy0001
2015-07-23 02:33:22 +10:00
parent 5ec4c244d2
commit d09dbee3c7
9 changed files with 296 additions and 174 deletions

View File

@ -27,6 +27,7 @@ import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.MainUtil;
@ -72,7 +73,17 @@ public class Claim extends SubCommand {
sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);
}
}
SchematicHandler.manager.paste(sch, plot2, 0, 0);
SchematicHandler.manager.paste(sch, plot2, 0, 0, new RunnableVal<Boolean>() {
@Override
public void run() {
if (value) {
MainUtil.sendMessage(player, C.SCHEMATIC_PASTE_SUCCESS);
}
else {
MainUtil.sendMessage(player, C.SCHEMATIC_PASTE_FAILED);
}
}
});
}
PS.get().getPlotManager(world).claimPlot(plotworld, plot);
}