mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Allow /plot home [area|world]
This commit is contained in:
parent
648953ec1f
commit
d843d1715d
1 changed files with 8 additions and 1 deletions
|
@ -107,6 +107,7 @@ public class HomeCommand extends Command {
|
||||||
PlotQuery query = query(player);
|
PlotQuery query = query(player);
|
||||||
int page = 1; // page = index + 1
|
int page = 1; // page = index + 1
|
||||||
String identifier;
|
String identifier;
|
||||||
|
PlotArea plotArea;
|
||||||
boolean basePlotOnly = true;
|
boolean basePlotOnly = true;
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -129,12 +130,18 @@ public class HomeCommand extends Command {
|
||||||
query.withPlot(fromId);
|
query.withPlot(fromId);
|
||||||
break;
|
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
|
// it wasn't a valid plot id, trying to find plot by alias
|
||||||
query.withAlias(identifier);
|
query.withAlias(identifier);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// we assume args[0] is a plot area and args[1] an identifier
|
// 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];
|
identifier = args[1];
|
||||||
if (plotArea == null) {
|
if (plotArea == null) {
|
||||||
// invalid command, therefore no plots
|
// invalid command, therefore no plots
|
||||||
|
|
Loading…
Reference in a new issue