<commit_before>package markehme.factionsplus.Cmds;

public class CmdSetRule extends FPCommand{
	//TODO: setrule
	@Override
	public void performfp() {
		// TODO Auto-generated method stub
		throw null;
		
	}
}<commit_msg>Updated CmdSetRule to work with FactionsPlusRules file<commit_after>package markehme.factionsplus.Cmds;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

import org.bukkit.ChatColor;

import markehme.factionsplus.FactionsPlus;
import markehme.factionsplus.FactionsPlusRules;
import markehme.factionsplus.FactionsBridge.Bridge;
import markehme.factionsplus.config.Config;

import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TextUtil;

public class CmdSetRule extends FPCommand{
	
	public CmdSetRule() {
		this.aliases.add("setrule");
		this.aliases.add("addrule");
		
		this.errorOnToManyArgs = false;
		
		this.requiredArgs.add("rule");
		//this.optionalArgs.put("on/off", "flip");

		this.permission = Permission.HELP.node;
		this.disableOnLock = false;
		
		senderMustBePlayer = true;
		senderMustBeMember = false;
		
		this.setHelpShort("manage Faction rules");
	}
	
	@Override
	public void performfp() {
		if(!FactionsPlus.permission.has(sender, "factionsplus.setrules")) {
			sender.sendMessage(ChatColor.RED + "No permission!");
			return;
		}
		
		String message = TextUtil.implode(args, " ").replaceAll("(&([a-f0-9]))", "& $2");
		
		fme.msg("Adding rule: " + message);
		
		FactionsPlusRules.setRuleForFaction(fme.getFaction(), fme, message);
		
	}
}
{'fraction_non_alphanumeric': 0.12538795779019243, 'fraction_numerical': 0.00186219739292365, 'mean_word_length': 4.883211678832117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6030090', 'n_tokens_mistral': 601, 'n_tokens_neox': 541, 'n_words': 97}