Fix /plot target nearest

This commit is contained in:
dordsor21 2020-07-11 13:40:22 +01:00
parent afb72aa102
commit a2ec404014
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -42,7 +42,7 @@ import com.plotsquared.core.util.StringMan;
public class Target extends SubCommand {
public Target() {
super(Argument.PlotID);
super();
}
@Override public boolean onCommand(PlotPlayer<?> player, String[] args) {
@ -51,6 +51,10 @@ public class Target extends SubCommand {
MainUtil.sendMessage(player, Captions.NOT_IN_PLOT_WORLD);
return false;
}
if (args.length == 0) {
MainUtil.sendMessage(player, this.getUsage());
return false;
}
Plot target = null;
if (StringMan.isEqualIgnoreCaseToAny(args[0], "near", "nearest")) {
int distance = Integer.MAX_VALUE;