<commit_before>package com.github.niwaniwa.we.core.util.lib.clickable;

import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;

import com.github.niwaniwa.we.core.util.Extension;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;

public class Clickable extends Extension {

	private JsonObject json;

	/**
	 * Constructor
	 * @param text 表示する文字列
	 * @param color 文字列の装飾
	 * @param formats フォーマット
	 */
	public Clickable(String text, ChatColor color, List<ChatFormat> formats) {
		json = new JsonObject();
		json.addProperty("text", text);
		if (color != null) {
			json.addProperty("color", color.toString().toLowerCase());
		}
		if (formats != null) { formats.forEach(f -> json.addProperty(f.getFormat(), true)); }
	}

	/**
	 * Eventなどを追加します
	 * @param extraInstance ChatExtra
	 */
	public void addExtra(ChatExtra extraInstance) {
		if (json.get("extra") == null) { return; }
		JsonArray extra = json.getAsJsonArray("extra");
		extra.add(extraInstance.toJson());
		json.add("extra", extra);
	}

	@Override
	public void send(Player player) {
		((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutChat(ChatSerializer.a(json.toString())));
	}

}
<commit_msg>Fix clickable<commit_after>package com.github.niwaniwa.we.core.util.lib.clickable;

import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;

import com.github.niwaniwa.we.core.util.Extension;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;

public class Clickable extends Extension {

	private JsonObject json;

	/**
	 * Constructor
	 * @param text 表示する文字列
	 * @param color 文字列の装飾
	 * @param formats フォーマット
	 */
	public Clickable(String text, ChatColor color, List<ChatFormat> formats) {
		json = new JsonObject();
		json.addProperty("text", text);
		if (color != null) {
			json.addProperty("color", color.toString().toLowerCase());
		}
		if (formats != null) { formats.forEach(f -> json.addProperty(f.getFormat(), true)); }
	}

	/**
	 * Eventなどを追加します
	 * @param extraInstance ChatExtra
	 */
	public void addExtra(ChatExtra extraInstance) {
		JsonArray extra = new JsonArray();
		extra.add(extraInstance.toJson());
		json.add("extra", extra);
	}

	@Override
	public void send(Player player) {
		((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutChat(ChatSerializer.a(json.toString())));
	}

}

{'fraction_non_alphanumeric': 0.13498920086393087, 'fraction_numerical': 0.0064794816414686825, 'mean_word_length': 4.938034188034188, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6080830', 'n_tokens_mistral': 1012, 'n_tokens_neox': 954, 'n_words': 172}