mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-02 08:50:17 +01:00
Fix some issues with console commandas
This commit is contained in:
parent
dd2cbeaaf8
commit
4939f997dc
@ -235,7 +235,6 @@ public class MainCommand extends CommandManager<PlotPlayer> {
|
||||
catch (NumberFormatException e) {}
|
||||
}
|
||||
else if (ConsolePlayer.isConsole(player) && args.length >= 2) {
|
||||
System.out.print(1);
|
||||
String[] split = args[0].split(";");
|
||||
String world;
|
||||
PlotId id;
|
||||
@ -252,10 +251,8 @@ public class MainCommand extends CommandManager<PlotPlayer> {
|
||||
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);
|
||||
}
|
||||
@ -298,7 +295,12 @@ public class MainCommand extends CommandManager<PlotPlayer> {
|
||||
{
|
||||
ArrayList<Command<PlotPlayer>> cmds = getCommands();
|
||||
cmd = new StringComparison<Command<PlotPlayer>>(label, cmds).getMatchObject();
|
||||
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, cmd.getUsage().replaceAll("{label}", label));
|
||||
if (cmd == null) {
|
||||
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, "/plot help");
|
||||
}
|
||||
else {
|
||||
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, cmd.getUsage().replaceAll("{label}", label));
|
||||
}
|
||||
}
|
||||
return CommandHandlingOutput.NOT_FOUND;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||
import com.intellectualcrafters.plot.object.ConsolePlayer;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.Rating;
|
||||
@ -32,6 +33,7 @@ import com.intellectualcrafters.plot.util.*;
|
||||
import com.plotsquared.bukkit.object.BukkitPlayer;
|
||||
import com.plotsquared.bukkit.util.bukkit.chat.FancyMessage;
|
||||
import com.plotsquared.general.commands.CommandDeclaration;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
@ -325,7 +327,7 @@ public class list extends SubCommand {
|
||||
}
|
||||
}
|
||||
i++;
|
||||
if (player != null && Settings.FANCY_CHAT) {
|
||||
if (!ConsolePlayer.isConsole(player) && Settings.FANCY_CHAT) {
|
||||
ChatColor color;
|
||||
if (plot.owner == null) {
|
||||
color = ChatColor.GOLD;
|
||||
|
@ -47,7 +47,6 @@ public class ConsolePlayer implements PlotPlayer {
|
||||
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
System.out.print(loc);
|
||||
return loc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user