<commit_before>package vg.civcraft.mc.civmenu;

import org.bukkit.command.Command;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import vg.civcraft.mc.civmenu.database.TOSManager;
import vg.civcraft.mc.civmenu.guides.DismissalCacheListener;
import vg.civcraft.mc.civmenu.guides.ResponseManager;
import vg.civcraft.mc.civmodcore.ACivMod;
import vg.civcraft.mc.civmodcore.annotations.CivConfig;
import vg.civcraft.mc.civmodcore.annotations.CivConfigType;
import vg.civcraft.mc.civmodcore.annotations.CivConfigs;
import vg.civcraft.mc.mercury.MercuryAPI;

public class CivMenu extends ACivMod {
	
	private TOSManager tosManager;
	private static CivMenu plugin;
	
	public void onEnable() {
		super.onEnable();
		plugin = this;
		tosManager = new TOSManager(this);
		ResponseManager.initWildcardDismissals();
		getServer().getPluginManager().registerEvents(new TOSListener(), this);
		getServer().getPluginManager().registerEvents(new DismissalCacheListener(), this);
		if (getServer().getPluginManager().isPluginEnabled("Mercury")){
			getServer().getPluginManager().registerEvents(new MercuryListener(), plugin);
			MercuryAPI.registerPluginMessageChannel("civmenu");
		}
		CommandHandler commandHandler = new CommandHandler(this);
		for (String command : getDescription().getCommands().keySet()) {
			getCommand(command).setExecutor(commandHandler);
		}
		
	}
	
	public void onLoad() {
		super.onLoad();
	}
	
    public void onDisable() { 
    	tosManager.save();
    }

    
	@CivConfigs({
		@CivConfig(name = "helpMenu.message", def = "Civcraft is a unique Minecraft server where the players make the rules. It's an experiment for communities, political ideologies, debate and discussion. Most Minecraft servers have rules, like “no griefing”, “no stealing”, or “be nice”. Civcraft doesn't. However, that doesn't mean you can run wild throughout the world, pillaging and plundering all that you come across, because Civcraft isn't an ordinary vanilla Minecraft server. We have a collection of plugins that encourages co-operation between players by increasing Minecraft's base difficulty tenfold and puts players in control of justice.", type = CivConfigType.String),
		@CivConfig(name = "helpMenu.plugins", def= "NameLayer, Citadel, JukeAlert, RealisticBiomes, ItemExchange, CivChat2", type = CivConfigType.String)
	})
    public void SendHelpMenu(Player player, JavaPlugin plugin){
		Menu menu = new Menu();

		if (plugin == null) {
			TextComponent title = new TextComponent("Civcraft Help Menu");
			title.setColor(ChatColor.RED);
			menu.setTitle(title);
			menu.setSubTitle(new TextComponent(this.GetConfig().get("helpMenu.message").getString()));
			String[] plugins = this.GetConfig().get("helpMenu.plugins").getString().split(", ");
			for(String pluginName:plugins){
				TextComponent part = new TextComponent(pluginName);
				part.setColor(ChatColor.YELLOW);
				part.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help " + pluginName));
				menu.addPart(part);
			}
			menu.sendPlayer(player);
			return;
		}
		
		menu.setTitle(new TextComponent(plugin.getName()));
		
		if (plugin.getDescription().getDescription() != null) {
			menu.setSubTitle(new TextComponent(plugin.getDescription()
					.getDescription()));
		}
		if (plugin.getDescription.getCommands() != null) {
			for (String commandName : plugin.getDescription().getCommands()
					.keySet()) {
				Command command = plugin.getCommand(commandName);
				if (command.getPermission() != null
						&& !player.hasPermission(command.getPermission())) {
					continue;
				}
				TextComponent part = new TextComponent(command.getLabel());
				part.setColor(ChatColor.YELLOW);
				part.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
						new ComponentBuilder(command.getUsage() + " \n"
								+ command.getDescription()).create()));
				part.setClickEvent(new ClickEvent(
						ClickEvent.Action.SUGGEST_COMMAND, "/" + command.getLabel()));
	<commit_msg>Fix derp<commit_after>package vg.civcraft.mc.civmenu;

import org.bukkit.command.Command;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import vg.civcraft.mc.civmenu.database.TOSManager;
import vg.civcraft.mc.civmenu.guides.DismissalCacheListener;
import vg.civcraft.mc.civmenu.guides.ResponseManager;
import vg.civcraft.mc.civmodcore.ACivMod;
import vg.civcraft.mc.civmodcore.annotations.CivConfig;
import vg.civcraft.mc.civmodcore.annotations.CivConfigType;
import vg.civcraft.mc.civmodcore.annotations.CivConfigs;
import vg.civcraft.mc.mercury.MercuryAPI;

public class CivMenu extends ACivMod {
	
	private TOSManager tosManager;
	private static CivMenu plugin;
	
	public void onEnable() {
		super.onEnable();
		plugin = this;
		tosManager = new TOSManager(this);
		ResponseManager.initWildcardDismissals();
		getServer().getPluginManager().registerEvents(new TOSListener(), this);
		getServer().getPluginManager().registerEvents(new DismissalCacheListener(), this);
		if (getServer().getPluginManager().isPluginEnabled("Mercury")){
			getServer().getPluginManager().registerEvents(new MercuryListener(), plugin);
			MercuryAPI.registerPluginMessageChannel("civmenu");
		}
		CommandHandler commandHandler = new CommandHandler(this);
		for (String command : getDescription().getCommands().keySet()) {
			getCommand(command).setExecutor(commandHandler);
		}
		
	}
	
	public void onLoad() {
		super.onLoad();
	}
	
    public void onDisable() { 
    	tosManager.save();
    }

    
	@CivConfigs({
		@CivConfig(name = "helpMenu.message", def = "Civcraft is a unique Minecraft server where the players make the rules. It's an experiment for communities, political ideologies, debate and discussion. Most Minecraft servers have rules, like “no griefing”, “no stealing”, or “be nice”. Civcraft doesn't. However, that doesn't mean you can run wild throughout the world, pillaging and plundering all that you come across, because Civcraft isn't an ordinary vanilla Minecraft server. We have a collection of plugins that encourages co-operation between players by increasing Minecraft's base difficulty tenfold and puts players in control of justice.", type = CivConfigType.String),
		@CivConfig(name = "helpMenu.plugins", def= "NameLayer, Citadel, JukeAlert, RealisticBiomes, ItemExchange, CivChat2", type = CivConfigType.String)
	})
    public void SendHelpMenu(Player player, JavaPlugin plugin){
		Menu menu = new Menu();

		if (plugin == null) {
			TextComponent title = new TextComponent("Civcraft Help Menu");
			title.setColor(ChatColor.RED);
			menu.setTitle(title);
			menu.setSubTitle(new TextComponent(this.GetConfig().get("helpMenu.message").getString()));
			String[] plugins = this.GetConfig().get("helpMenu.plugins").getString().split(", ");
			for(String pluginName:plugins){
				TextComponent part = new TextComponent(pluginName);
				part.setColor(ChatColor.YELLOW);
				part.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help " + pluginName));
				menu.addPart(part);
			}
			menu.sendPlayer(player);
			return;
		}
		
		menu.setTitle(new TextComponent(plugin.getName()));
		
		if (plugin.getDescription().getDescription() != null) {
			menu.setSubTitle(new TextComponent(plugin.getDescription()
					.getDescription()));
		}
		if (plugin.getDescription().getCommands() != null) {
			for (String commandName : plugin.getDescription().getCommands()
					.keySet()) {
				Command command = plugin.getCommand(commandName);
				if (command.getPermission() != null
						&& !player.hasPermission(command.getPermission())) {
					continue;
				}
				TextComponent part = new TextComponent(command.getLabel());
				part.setColor(ChatColor.YELLOW);
				part.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
						new ComponentBuilder(command.getUsage() + " \n"
								+ command.getDescription()).create()));
				part.setClickEvent(new ClickEvent(
						ClickEvent.Action.SUGGEST_COMMAND, "/" + command.getLabel()));
	
{'fraction_non_alphanumeric': 0.12236638495417212, 'fraction_numerical': 0.0014284013807880013, 'mean_word_length': 5.035919540229885, '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': '512561', 'n_tokens_mistral': 2845, 'n_tokens_neox': 2527, 'n_words': 539}