Merge branch '1.6.x' of https://github.com/vemacs/Factions into vemacs

This commit is contained in:
drtshock
2015-03-06 16:32:20 -07:00
9 changed files with 73 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ public class CmdHelp extends FCommand {
pageLines.add(p.cmdBase.cmdJoin.getUseageTemplate(true));
pageLines.add(p.cmdBase.cmdLeave.getUseageTemplate(true));
pageLines.add(p.cmdBase.cmdChat.getUseageTemplate(true));
pageLines.add(p.cmdBase.cmdToggleAllianceChat.getUseageTemplate(true));
pageLines.add(p.cmdBase.cmdHome.getUseageTemplate(true));
pageLines.add(p.txt.parse(TL.COMMAND_HELP_NEXTCREATE.toString()));
helpPages.add(pageLines);

View File

@@ -0,0 +1,43 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
public class CmdToggleAllianceChat extends FCommand {
public CmdToggleAllianceChat() {
super();
this.aliases.add("tac");
this.aliases.add("togglealliancechat");
this.aliases.add("ac");
this.disableOnLock = false;
this.permission = Permission.TOGGLE_ALLIANCE_CHAT.node;
this.disableOnLock = false;
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeAdmin = false;
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_TOGGLEALLIANCECHAT_DESCRIPTION;
}
@Override
public void perform() {
if (!Conf.factionOnlyChat) {
msg(TL.COMMAND_CHAT_DISABLED.toString());
return;
}
boolean ignoring = fme.isIgnoreAllianceChat();
msg(ignoring ? TL.COMMAND_TOGGLEALLIANCECHAT_UNIGNORE : TL.COMMAND_TOGGLEALLIANCECHAT_IGNORE);
fme.setIgnoreAllianceChat(!ignoring);
}
}

View File

@@ -49,6 +49,7 @@ public class FCmdRoot extends FCommand {
public CmdStatus cmdStatus = new CmdStatus();
public CmdTag cmdTag = new CmdTag();
public CmdTitle cmdTitle = new CmdTitle();
public CmdToggleAllianceChat cmdToggleAllianceChat = new CmdToggleAllianceChat();
public CmdUnclaim cmdUnclaim = new CmdUnclaim();
public CmdUnclaimall cmdUnclaimall = new CmdUnclaimall();
public CmdVersion cmdVersion = new CmdVersion();
@@ -69,7 +70,7 @@ public class FCmdRoot extends FCommand {
public FCmdRoot() {
super();
this.aliases.addAll(Conf.baseCommandAliases);
this.aliases.removeAll(Collections.singletonList(null)); // remove any nulls from extra commas
this.aliases.removeAll(Collections.<String>singletonList(null)); // remove any nulls from extra commas
this.allowNoSlashAccess = Conf.allowNoSlashCommand;
//this.requiredArgs.add("");
@@ -92,6 +93,7 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdBoom);
this.addSubCommand(this.cmdBypass);
this.addSubCommand(this.cmdChat);
this.addSubCommand(this.cmdToggleAllianceChat);
this.addSubCommand(this.cmdChatSpy);
this.addSubCommand(this.cmdClaim);
this.addSubCommand(this.cmdConfig);