mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-27 12:45:59 +01:00
Minor stuff
This commit is contained in:
parent
955fa674d0
commit
e50605d69a
@ -29,6 +29,8 @@ import com.intellectualcrafters.plot.PS;
|
|||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.config.Settings;
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
import com.intellectualcrafters.plot.object.ConsolePlayer;
|
import com.intellectualcrafters.plot.object.ConsolePlayer;
|
||||||
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
|
import com.intellectualcrafters.plot.object.PlotId;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.MathMan;
|
import com.intellectualcrafters.plot.util.MathMan;
|
||||||
@ -192,7 +194,7 @@ public class MainCommand extends CommandManager<PlotPlayer> {
|
|||||||
.render();
|
.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean onCommand(final PlotPlayer player, final String cmd, final String... args) {
|
public static boolean onCommand(final PlotPlayer player, final String cmd, String... args) {
|
||||||
int help_index = -1;
|
int help_index = -1;
|
||||||
String category = null;
|
String category = null;
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
@ -232,6 +234,34 @@ public class MainCommand extends CommandManager<PlotPlayer> {
|
|||||||
}
|
}
|
||||||
catch (NumberFormatException e) {}
|
catch (NumberFormatException e) {}
|
||||||
}
|
}
|
||||||
|
else if (ConsolePlayer.isConsole(player) && args.length >= 2) {
|
||||||
|
System.out.print(1);
|
||||||
|
String[] split = args[0].split(";");
|
||||||
|
String world;
|
||||||
|
PlotId id;
|
||||||
|
if (split.length == 2) {
|
||||||
|
world = player.getLocation().getWorld();
|
||||||
|
id = PlotId.fromString(split[0] + ";" + split[1]);
|
||||||
|
}
|
||||||
|
else if (split.length == 3) {
|
||||||
|
world = split[0];
|
||||||
|
id = PlotId.fromString(split[1] + ";" + split[2]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
id = null;
|
||||||
|
world = null;
|
||||||
|
}
|
||||||
|
if (id != null && PS.get().isPlotWorld(world)) {
|
||||||
|
System.out.print(2 + " | " + id + " | " + world);
|
||||||
|
Plot plot = MainUtil.getPlot(world, id);
|
||||||
|
if (plot != null) {
|
||||||
|
System.out.print(3 + " | " + plot);
|
||||||
|
player.teleport(MainUtil.getPlotCenter(plot));
|
||||||
|
args = Arrays.copyOfRange(args, 1, args.length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (help_index != -1) {
|
if (help_index != -1) {
|
||||||
displayHelp(player, category, help_index, cmd);
|
displayHelp(player, category, help_index, cmd);
|
||||||
return true;
|
return true;
|
||||||
@ -268,7 +298,7 @@ public class MainCommand extends CommandManager<PlotPlayer> {
|
|||||||
{
|
{
|
||||||
ArrayList<Command<PlotPlayer>> cmds = getCommands();
|
ArrayList<Command<PlotPlayer>> cmds = getCommands();
|
||||||
cmd = new StringComparison<Command<PlotPlayer>>(label, cmds).getMatchObject();
|
cmd = new StringComparison<Command<PlotPlayer>>(label, cmds).getMatchObject();
|
||||||
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, cmd.getUsage());
|
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, cmd.getUsage().replaceAll("{label}", label));
|
||||||
}
|
}
|
||||||
return CommandHandlingOutput.NOT_FOUND;
|
return CommandHandlingOutput.NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ public class ConsolePlayer implements PlotPlayer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Location getLocation() {
|
public Location getLocation() {
|
||||||
|
System.out.print(loc);
|
||||||
return loc;
|
return loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user