mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fixes #1015
This commit is contained in:
parent
5f8a55568c
commit
eed8cbec5a
@ -397,9 +397,8 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
||||
if (econ.init()) {
|
||||
return econ;
|
||||
}
|
||||
System.out.println("ECONOMY ENABLED!");
|
||||
} catch (Throwable ignored) {
|
||||
ignored.printStackTrace();
|
||||
PS.debug("No economy detected!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -263,7 +263,6 @@ public class PS {
|
||||
TaskManager.runTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("SETTING UP ECON");
|
||||
EconHandler.manager = PS.this.IMP.getEconomyHandler();
|
||||
}
|
||||
});
|
||||
|
@ -49,10 +49,6 @@ public class Add extends SubCommand {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(PlotPlayer plr, String[] args) {
|
||||
if (args.length != 1) {
|
||||
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, this.getUsage());
|
||||
return true;
|
||||
}
|
||||
Location loc = plr.getLocation();
|
||||
Plot plot = loc.getPlotAbs();
|
||||
if (plot == null) {
|
||||
|
@ -49,10 +49,6 @@ public class Remove extends SubCommand {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(PlotPlayer plr, String[] args) {
|
||||
if (args.length != 1) {
|
||||
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, this.getUsage());
|
||||
return true;
|
||||
}
|
||||
Location loc = plr.getLocation();
|
||||
Plot plot = loc.getPlotAbs();
|
||||
if (plot == null) {
|
||||
|
@ -48,10 +48,6 @@ public class Trust extends SubCommand {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(PlotPlayer plr, String[] args) {
|
||||
if (args.length != 1) {
|
||||
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, this.getUsage());
|
||||
return true;
|
||||
}
|
||||
Location loc = plr.getLocation();
|
||||
Plot plot = loc.getPlotAbs();
|
||||
if (plot == null) {
|
||||
|
@ -14,7 +14,6 @@ import com.intellectualcrafters.plot.util.MathMan;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.StringComparison;
|
||||
import com.intellectualcrafters.plot.util.StringMan;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@ -323,7 +322,15 @@ public abstract class Command {
|
||||
}
|
||||
return;
|
||||
}
|
||||
Argument<?>[] reqArgs = cmd.getRequiredArguments();
|
||||
String[] newArgs = Arrays.copyOfRange(args, 1, args.length);
|
||||
if (!cmd.checkArgs(player, newArgs) || !cmd.canExecute(player, true)) {
|
||||
return;
|
||||
}
|
||||
cmd.execute(player, newArgs, confirm, whenDone);
|
||||
}
|
||||
|
||||
public boolean checkArgs(PlotPlayer player, String[] args) {
|
||||
Argument<?>[] reqArgs = getRequiredArguments();
|
||||
if ((reqArgs != null) && (reqArgs.length > 0)) {
|
||||
boolean failed = args.length < reqArgs.length;
|
||||
String[] baseSplit = getCommandString().split(" ");
|
||||
@ -335,13 +342,10 @@ public abstract class Command {
|
||||
}
|
||||
if (failed) {
|
||||
C.COMMAND_SYNTAX.send(player, StringMan.join(fullSplit, " "));
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!cmd.canExecute(player, true)) {
|
||||
return;
|
||||
}
|
||||
cmd.execute(player, Arrays.copyOfRange(args, 1, args.length), confirm, whenDone);
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getMatch(String[] args, Command cmd) {
|
||||
|
Loading…
Reference in New Issue
Block a user