Updated Merging all plots (markdown)

NotMyFault 2020-02-16 18:04:10 +01:00
parent fbf5e244cc
commit 87d87afd9a

@ -1,53 +1,22 @@
## This guide is for PlotSquared versions <= 1.12.2
Download: (included with P^2)
``` javascript
/*
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:
- PS
- 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
/plot debugexec runasync automerge.js <removeroads>
*/
var plots = PS.sortPlots(PS.getPlots());
PS.class.static.log('Attempting to auto merge ' + plots.size() + ' plots');
if ('%s0' === 'true') {
var plots = PS.sortPlotsByTemp(PS.getPlots());
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);
plot.autoMerge(false);
plot.autoMerge(-1, 250000, plot.owner, true);
}
}
else if ('%s0' === 'false') {
} else if ("%s0" === "false") {
for (var i = 0; i < plots.size(); i++) {
var plot = plots.get(i);
plot.autoMerge(false);
plot.autoMerge(-1, 250000, plot.owner, false);
}
}
else {
C_COMMAND_SYNTAX.send(PlotPlayer, '/plot debugexec automerge.js <removeroads>');
MainUtil.class.static.sendMessage(PlotPlayer, '$1<removeroads> is true or false if you want to remove roads when auto merging');
} else {
C_COMMAND_SYNTAX.send(PlotPlayer, "/plot debugexec automerge.js <removeroads>");
MainUtil.class.static.sendMessage(PlotPlayer, "$1<removeroads> is true or false if you want to remove roads when auto merging");
}
```