mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Add near cmd
This commit is contained in:
parent
86b776f742
commit
04c011164a
@ -64,6 +64,7 @@ public class MainCommand extends Command {
|
|||||||
new Deny();
|
new Deny();
|
||||||
new Remove();
|
new Remove();
|
||||||
new Info();
|
new Info();
|
||||||
|
new Near();
|
||||||
new ListCmd();
|
new ListCmd();
|
||||||
new Debug();
|
new Debug();
|
||||||
new SchematicCmd();
|
new SchematicCmd();
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.intellectualcrafters.plot.commands;
|
||||||
|
|
||||||
|
import com.intellectualcrafters.plot.config.C;
|
||||||
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
|
import com.intellectualcrafters.plot.object.RunnableVal2;
|
||||||
|
import com.intellectualcrafters.plot.object.RunnableVal3;
|
||||||
|
import com.intellectualcrafters.plot.util.StringMan;
|
||||||
|
import com.plotsquared.general.commands.Command;
|
||||||
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
|
@CommandDeclaration(command = "near",
|
||||||
|
aliases = "n",
|
||||||
|
description = "Display nearby players",
|
||||||
|
usage = "/plot near",
|
||||||
|
category = CommandCategory.INFO)
|
||||||
|
public class Near extends Command {
|
||||||
|
public Near() {
|
||||||
|
super(MainCommand.getInstance(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(PlotPlayer player, String[] args, RunnableVal3<Command, Runnable, Runnable> confirm, RunnableVal2<Command, CommandResult> whenDone) throws CommandException {
|
||||||
|
final Plot plot = check(player.getCurrentPlot(), C.NOT_IN_PLOT);
|
||||||
|
C.PLOT_NEAR.send(player, StringMan.join(plot.getPlayersInPlot(), ", "));
|
||||||
|
}
|
||||||
|
}
|
@ -454,6 +454,10 @@ public enum C {
|
|||||||
NEED_PLOT_ID("$2You've got to specify a plot id.", "Need"),
|
NEED_PLOT_ID("$2You've got to specify a plot id.", "Need"),
|
||||||
NEED_PLOT_WORLD("$2You've got to specify a plot area.", "Need"),
|
NEED_PLOT_WORLD("$2You've got to specify a plot area.", "Need"),
|
||||||
NEED_USER("$2You need to specify a username", "Need"),
|
NEED_USER("$2You need to specify a username", "Need"),
|
||||||
|
/*
|
||||||
|
* Near
|
||||||
|
*/
|
||||||
|
PLOT_NEAR("$1Players: %s0", "Near"),
|
||||||
/*
|
/*
|
||||||
* Info
|
* Info
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user