Introduced Brigadier Command System. More Formatting Coming in next commit.

This commit is contained in:
Driftay
2019-09-14 15:13:01 -04:00
parent b06e6e0f04
commit 3c9b606bb9
207 changed files with 4465 additions and 4017 deletions

View File

@@ -1,37 +0,0 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.zcore.util.TL;
public class CmdNotifications extends FCommand {
public CmdNotifications() {
this.aliases.add("notifications");
this.aliases.add("messages");
this.optionalArgs.put("on/off", "flip");
this.senderMustBeMember = true;
this.senderMustBeModerator = false;
}
@Override
public void perform() {
if (args.size() == 0) {
toggleNotifications(!fme.hasNotificationsEnabled());
} else if (args.size() == 1) {
toggleNotifications(argAsBool(0));
}
}
private void toggleNotifications(boolean toggle) {
fme.setNotificationsEnabled(toggle);
if (toggle) {
fme.msg(TL.COMMAND_NOTIFICATIONS_TOGGLED_ON);
} else {
fme.msg(TL.COMMAND_NOTIFICATIONS_TOGGLED_OFF);
}
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_NOTIFICATIONS_DESCRIPTION;
}
}