2018-06-08 21:19:15 +00:00
|
|
|
/*
|
|
|
|
Need to script something quick with PlotSquared?
|
|
|
|
/plot debugexec runasync automerge.js <removeroads>
|
|
|
|
|
|
|
|
This is an example script that will auto merge all plots
|
|
|
|
|
|
|
|
The following utility classes are usable:
|
2019-08-19 00:12:51 +00:00
|
|
|
- PlotSquared
|
2018-06-08 21:19:15 +00:00
|
|
|
- TaskManager
|
|
|
|
- TitleManager
|
|
|
|
- ConsolePlayer
|
|
|
|
- SchematicHandler
|
|
|
|
- ChunkManager
|
|
|
|
- BlockManager
|
|
|
|
- SetupUtils
|
|
|
|
- EventUtil
|
|
|
|
- UUIDHandler
|
|
|
|
- DBFunc
|
|
|
|
- HybridUtils
|
|
|
|
- IMP ( BukkitMain or SpongeMain)
|
|
|
|
- MainCommand
|
|
|
|
- MainUtil
|
|
|
|
- Settings
|
|
|
|
- StringMan
|
|
|
|
- MathMan
|
|
|
|
- C ( use C_ )
|
|
|
|
- Permissions ( use Permissions_ )
|
|
|
|
|
|
|
|
For more information see: https://github.com/IntellectualSites/PlotSquared/wiki/Scripting
|
|
|
|
*/
|
2019-08-19 00:12:51 +00:00
|
|
|
var plots = PS.sortPlotsByTemp(PS.getPlots());
|
2018-06-08 21:19:15 +00:00
|
|
|
PS.class.static.log("Attempting to auto merge " + plots.size() + " plots");
|
|
|
|
if ("%s0" === "true") {
|
|
|
|
for (var i = 0; i < plots.size(); i++) {
|
|
|
|
var plot = plots.get(i);
|
2019-08-19 00:12:51 +00:00
|
|
|
plot.autoMerge(-1, 250000, plot.owner, true);
|
2018-06-08 21:19:15 +00:00
|
|
|
}
|
2019-08-19 00:12:51 +00:00
|
|
|
} else if ("%s0" === "false") {
|
2018-06-08 21:19:15 +00:00
|
|
|
for (var i = 0; i < plots.size(); i++) {
|
|
|
|
var plot = plots.get(i);
|
2019-08-19 00:12:51 +00:00
|
|
|
plot.autoMerge(-1, 250000, plot.owner, false);
|
2018-06-08 21:19:15 +00:00
|
|
|
}
|
2019-08-19 00:12:51 +00:00
|
|
|
} else {
|
2018-06-08 21:19:15 +00:00
|
|
|
C_COMMAND_SYNTAX.send(PlotPlayer, "/plot debugexec automerge.js <removeroads>");
|
2019-08-19 00:12:51 +00:00
|
|
|
MainUtil.class.static.sendMessage(PlotPlayer, "$1<removeroads> is true or false if you want to remove roads when auto merging");
|
|
|
|
}
|