mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 12:25:46 +01:00
Fix a few issues with debugexec
This commit is contained in:
parent
295a63087f
commit
0cdda8b0ae
@ -49,8 +49,12 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@CommandDeclaration(command = "debugexec",
|
@CommandDeclaration(command = "debugexec",
|
||||||
permission = "plots.admin",
|
permission = "plots.admin",
|
||||||
@ -58,8 +62,6 @@ import java.util.List;
|
|||||||
category = CommandCategory.DEBUG)
|
category = CommandCategory.DEBUG)
|
||||||
public class DebugExec extends SubCommand {
|
public class DebugExec extends SubCommand {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger("P2/" + DebugExec.class.getSimpleName());
|
|
||||||
|
|
||||||
private final PlotAreaManager plotAreaManager;
|
private final PlotAreaManager plotAreaManager;
|
||||||
private final EventDispatcher eventDispatcher;
|
private final EventDispatcher eventDispatcher;
|
||||||
private final HybridUtils hybridUtils;
|
private final HybridUtils hybridUtils;
|
||||||
@ -155,8 +157,10 @@ public class DebugExec extends SubCommand {
|
|||||||
case "stop-expire":
|
case "stop-expire":
|
||||||
if (ExpireManager.IMP == null || !ExpireManager.IMP.cancelTask()) {
|
if (ExpireManager.IMP == null || !ExpireManager.IMP.cancelTask()) {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.task_halted"));
|
player.sendMessage(TranslatableCaption.of("debugexec.task_halted"));
|
||||||
}
|
} else {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled"));
|
player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled"));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
case "remove-flag":
|
case "remove-flag":
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -220,9 +224,17 @@ public class DebugExec extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.sendMessage(StaticCaption.of("<prefix><gold>Possible sub commands: </gray>/plot debugexec <"
|
player.sendMessage(StaticCaption.of("<prefix><gold>Possible sub commands: </gold><gray>/plot debugexec <"
|
||||||
+ StringMan.join(allowedParams, " | ") + "></gray>"));
|
+ StringMan.join(allowedParams, " | ") + "></gray>"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<Command> tab(final PlotPlayer<?> player, String[] args, boolean space) {
|
||||||
|
return Stream.of("analyze", "calibrate-analysis", "start-expire", "stop-expire", "remove-flag", "start-rgar", "stop-rgar")
|
||||||
|
.filter(value -> value.startsWith(args[0].toLowerCase(Locale.ENGLISH)))
|
||||||
|
.map(value -> new Command(null, false, value, "plots.admin", RequiredType.NONE, null) {
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1174,7 +1174,7 @@ public class Plot {
|
|||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
public boolean removeFlag(final @NonNull PlotFlag<?, ?> flag) {
|
public boolean removeFlag(final @NonNull PlotFlag<?, ?> flag) {
|
||||||
if (flag == null) {
|
if (flag == null || origin == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean removed = false;
|
boolean removed = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user