add toggle command
This commit is contained in:
parent
90480fccf4
commit
f7737de145
2 changed files with 32 additions and 0 deletions
|
@ -66,6 +66,7 @@ public class Setup {
|
||||||
new Spotify(),
|
new Spotify(),
|
||||||
new Test(),
|
new Test(),
|
||||||
new Timer(),
|
new Timer(),
|
||||||
|
new Toggle(),
|
||||||
new TPAccept(),
|
new TPAccept(),
|
||||||
new Trigger(),
|
new Trigger(),
|
||||||
new Trust(),
|
new Trust(),
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package de.com.baseband.client.feature.command;
|
||||||
|
|
||||||
|
import de.com.baseband.client.feature.Feature;
|
||||||
|
import de.com.baseband.client.feature.Features;
|
||||||
|
import de.com.baseband.client.feature.category.Command;
|
||||||
|
import de.com.baseband.client.feature.client.Client;
|
||||||
|
import de.com.baseband.client.util.interact.Chat;
|
||||||
|
|
||||||
|
@Command
|
||||||
|
public class Toggle extends Feature {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCommand(String[] args) {
|
||||||
|
if(args.length != 1) {
|
||||||
|
Chat.print("Syntax: " + Client.prefix + this + " <module>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (Feature feature : Features.features) {
|
||||||
|
if(feature.toString().equalsIgnoreCase(args[0])) {
|
||||||
|
feature.toggle();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Chat.print("Toggled!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "T";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue