mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Add option to disable commands
This commit is contained in:
parent
4632f0d4f3
commit
99c4c2f35d
@ -69,6 +69,13 @@ public class Settings extends Config {
|
||||
public PATHS PATHS;
|
||||
@Create
|
||||
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")
|
||||
public static final class PATHS {
|
||||
|
@ -25,6 +25,7 @@ import com.boydti.fawe.command.CFICommand;
|
||||
import com.boydti.fawe.command.MaskBinding;
|
||||
import com.boydti.fawe.command.PatternBinding;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
import com.boydti.fawe.object.task.ThrowableSupplier;
|
||||
@ -257,6 +258,7 @@ public final class CommandManager {
|
||||
* Initialize the dispatcher
|
||||
*/
|
||||
public synchronized void setupDispatcher() {
|
||||
if (Settings.IMP.ENABLED_COMPONENTS.COMMANDS) {
|
||||
DispatcherNode graph = new CommandGraph().builder(builder).commands();
|
||||
|
||||
for (Map.Entry<Object, String[]> entry : methodMap.entrySet()) {
|
||||
@ -324,6 +326,7 @@ public final class CommandManager {
|
||||
platform.registerCommands(dispatcher);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static CommandManager getInstance() {
|
||||
return INSTANCE;
|
||||
|
Loading…
Reference in New Issue
Block a user