Add option to disable commands

Dieser Commit ist enthalten in:
Jesse Boyd 2019-04-12 10:51:18 +10:00
Ursprung 4632f0d4f3
Commit 99c4c2f35d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
2 geänderte Dateien mit 68 neuen und 58 gelöschten Zeilen

Datei anzeigen

@ -69,6 +69,13 @@ public class Settings extends Config {
public PATHS PATHS; public PATHS PATHS;
@Create @Create
public REGION_RESTRICTIONS_OPTIONS REGION_RESTRICTIONS_OPTIONS; public REGION_RESTRICTIONS_OPTIONS REGION_RESTRICTIONS_OPTIONS;
@Create
public ENABLED_COMPONENTS ENABLED_COMPONENTS;
@Comment("Enable or disable core components")
public static final class ENABLED_COMPONENTS {
public boolean COMMANDS = true;
}
@Comment("Paths for various directories") @Comment("Paths for various directories")
public static final class PATHS { public static final class PATHS {

Datei anzeigen

@ -25,6 +25,7 @@ import com.boydti.fawe.command.CFICommand;
import com.boydti.fawe.command.MaskBinding; import com.boydti.fawe.command.MaskBinding;
import com.boydti.fawe.command.PatternBinding; import com.boydti.fawe.command.PatternBinding;
import com.boydti.fawe.config.BBC; import com.boydti.fawe.config.BBC;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.FawePlayer; import com.boydti.fawe.object.FawePlayer;
import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.object.task.ThrowableSupplier; import com.boydti.fawe.object.task.ThrowableSupplier;
@ -257,6 +258,7 @@ public final class CommandManager {
* Initialize the dispatcher * Initialize the dispatcher
*/ */
public synchronized void setupDispatcher() { public synchronized void setupDispatcher() {
if (Settings.IMP.ENABLED_COMPONENTS.COMMANDS) {
DispatcherNode graph = new CommandGraph().builder(builder).commands(); DispatcherNode graph = new CommandGraph().builder(builder).commands();
for (Map.Entry<Object, String[]> entry : methodMap.entrySet()) { for (Map.Entry<Object, String[]> entry : methodMap.entrySet()) {
@ -324,6 +326,7 @@ public final class CommandManager {
platform.registerCommands(dispatcher); platform.registerCommands(dispatcher);
} }
} }
}
public static CommandManager getInstance() { public static CommandManager getInstance() {
return INSTANCE; return INSTANCE;