mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 12:25:46 +01:00
Allow /plot home [area|world]
This commit is contained in:
parent
648953ec1f
commit
d843d1715d
@ -107,6 +107,7 @@ public class HomeCommand extends Command {
|
||||
PlotQuery query = query(player);
|
||||
int page = 1; // page = index + 1
|
||||
String identifier;
|
||||
PlotArea plotArea;
|
||||
boolean basePlotOnly = true;
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
@ -129,12 +130,18 @@ public class HomeCommand extends Command {
|
||||
query.withPlot(fromId);
|
||||
break;
|
||||
}
|
||||
// allow for plot home within a plot area
|
||||
plotArea = PlotSquared.get().getPlotAreaByString(args[0]);
|
||||
if (plotArea != null) {
|
||||
query.inArea(plotArea);
|
||||
break;
|
||||
}
|
||||
// it wasn't a valid plot id, trying to find plot by alias
|
||||
query.withAlias(identifier);
|
||||
break;
|
||||
case 2:
|
||||
// we assume args[0] is a plot area and args[1] an identifier
|
||||
PlotArea plotArea = PlotSquared.get().getPlotAreaByString(args[0]);
|
||||
plotArea = PlotSquared.get().getPlotAreaByString(args[0]);
|
||||
identifier = args[1];
|
||||
if (plotArea == null) {
|
||||
// invalid command, therefore no plots
|
||||
|
Loading…
Reference in New Issue
Block a user