<commit_before>package protocolsupportpocketstuff;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import protocolsupport.api.Connection;
import protocolsupport.api.events.ConnectionHandshakeEvent;
import protocolsupport.api.events.ConnectionOpenEvent;
import protocolsupport.api.unsafe.peskins.PESkinsProviderSPI;
import protocolsupportpocketstuff.api.PocketStuffAPI;
import protocolsupportpocketstuff.api.util.PocketCon;
import protocolsupportpocketstuff.commands.CommandHandler;
import protocolsupportpocketstuff.hacks.dimensions.DimensionListener;
import protocolsupportpocketstuff.packet.handshake.ClientLoginPacket;
import protocolsupportpocketstuff.packet.play.ModalResponsePacket;
import protocolsupportpocketstuff.packet.play.SkinPacket;
import protocolsupportpocketstuff.resourcepacks.ResourcePackManager;
import protocolsupportpocketstuff.skin.PcToPeProvider;
import protocolsupportpocketstuff.skin.SkinListener;
import protocolsupportpocketstuff.storage.Skins;
import protocolsupportpocketstuff.util.ResourcePackListener;

import java.io.File;

public class ProtocolSupportPocketStuff extends JavaPlugin implements Listener {
	public static final String PREFIX = "[" + ChatColor.DARK_PURPLE + "PSPS" + ChatColor.RESET + "] ";
	private static ProtocolSupportPocketStuff INSTANCE;

	public static ProtocolSupportPocketStuff getInstance() {
		return INSTANCE;
	}

	@Override
	public void onEnable() {
		INSTANCE = this;

		getCommand("protocolsupportpocketstuff").setExecutor(new CommandHandler());

		// = Config = \\
		saveDefaultConfig();

		new File(this.getDataFolder(), ResourcePackManager.FOLDER_NAME + "/").mkdirs();

		ResourcePackManager resourcePackManager = new ResourcePackManager(this);
		resourcePackManager.reloadPacks();
		PocketStuffAPI.setResourcePackManager(resourcePackManager);

		// = Events = \\
		PluginManager pm = getServer().getPluginManager();
		pm.registerEvents(this, this);
		if(getConfig().getBoolean("skins.PCtoPE")) { pm.registerEvents(new SkinListener(this), this); }
		if(getConfig().getBoolean("hacks.dimensions")) { pm.registerEvents(new DimensionListener(), this); }
		
		// = SPI = \\
		if(getConfig().getBoolean("skins.PCtoPE")) { PESkinsProviderSPI.setProvider(new PcToPeProvider(this)); }
		
		// = Cache = \\
		Skins.INSTANCE.buildCache(getConfig().getInt("skins.cache-size"), getConfig().getInt("skins.cache-rate"));
		
		pm("Hello world! :D");
	}

	@EventHandler
	public void onConnectionOpen(ConnectionOpenEvent e) {
		Connection con = e.getConnection();
		// We can't check if it is a PE player yet because it is too early to figure out
		con.addPacketListener(new ClientLoginPacket().new decodeHandler(this, con));
	}

	@EventHandler
	public void onConnectionHandshake(ConnectionHandshakeEvent e) {
		Connection con = e.getConnection();
		if(PocketCon.isPocketConnection(con)) {
			
			// = Packet Listeners = \\
			con.addPacketListener(new ModalResponsePacket().new decodeHandler(this, con));
			con.addPacketListener(new ResourcePackListener(this, con));
			if(getConfig().getBoolean("skins.PEtoPC")) { con.addPacketListener(new SkinPacket().new decodeHandler(this, con)); }
			
		}
	}
	
	@Override
	public void onDisable() {
		pm("Bye world :O");
	}
	<commit_msg>Register our own:tm: custom metadata provider<commit_after>package protocolsupportpocketstuff;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import protocolsupport.api.Connection;
import protocolsupport.api.events.ConnectionHandshakeEvent;
import protocolsupport.api.events.ConnectionOpenEvent;
import protocolsupport.api.unsafe.pemetadata.PEMetaProviderSPI;
import protocolsupport.api.unsafe.peskins.PESkinsProviderSPI;
import protocolsupportpocketstuff.api.PocketStuffAPI;
import protocolsupportpocketstuff.api.util.PocketCon;
import protocolsupportpocketstuff.commands.CommandHandler;
import protocolsupportpocketstuff.hacks.dimensions.DimensionListener;
import protocolsupportpocketstuff.metadata.MetadataProvider;
import protocolsupportpocketstuff.packet.handshake.ClientLoginPacket;
import protocolsupportpocketstuff.packet.play.ModalResponsePacket;
import protocolsupportpocketstuff.packet.play.SkinPacket;
import protocolsupportpocketstuff.resourcepacks.ResourcePackManager;
import protocolsupportpocketstuff.skin.PcToPeProvider;
import protocolsupportpocketstuff.skin.SkinListener;
import protocolsupportpocketstuff.storage.Skins;
import protocolsupportpocketstuff.util.ResourcePackListener;

import java.io.File;

public class ProtocolSupportPocketStuff extends JavaPlugin implements Listener {
	public static final String PREFIX = "[" + ChatColor.DARK_PURPLE + "PSPS" + ChatColor.RESET + "] ";
	private static ProtocolSupportPocketStuff INSTANCE;

	public static ProtocolSupportPocketStuff getInstance() {
		return INSTANCE;
	}

	@Override
	public void onEnable() {
		INSTANCE = this;

		getCommand("protocolsupportpocketstuff").setExecutor(new CommandHandler());

		// = Config = \\
		saveDefaultConfig();

		new File(this.getDataFolder(), ResourcePackManager.FOLDER_NAME + "/").mkdirs();

		ResourcePackManager resourcePackManager = new ResourcePackManager(this);
		resourcePackManager.reloadPacks();
		PocketStuffAPI.setResourcePackManager(resourcePackManager);

		// = Events = \\
		PluginManager pm = getServer().getPluginManager();
		pm.registerEvents(this, this);
		if(getConfig().getBoolean("skins.PCtoPE")) { pm.registerEvents(new SkinListener(this), this); }
		if(getConfig().getBoolean("hacks.dimensions")) { pm.registerEvents(new DimensionListener(), this); }
		
		// = SPI = \\
		if(getConfig().getBoolean("skins.PCtoPE")) { PESkinsProviderSPI.setProvider(new PcToPeProvider(this)); }
		PEMetaProviderSPI.setProvider(new MetadataProvider());

		// = Cache = \\
		Skins.INSTANCE.buildCache(getConfig().getInt("skins.cache-size"), getConfig().getInt("skins.cache-rate"));
		
		pm("Hello world! :D");
	}

	@EventHandler
	public void onConnectionOpen(ConnectionOpenEvent e) {
		Connection con = e.getConnection();
		// We can't check if it is a PE player yet because it is too early to figure out
		con.addPacketListener(new ClientLoginPacket().new decodeHandler(this, con));
	}

	@EventHandler
	public void onConnectionHandshake(ConnectionHandshakeEvent e) {
		Connection con = e.getConnection();
		if(PocketCon.isPocketConnection(con)) {
			
			// = Packet Listeners = \\
			con.addPacketListener(new ModalResponsePacket().new decodeHandler(this, con));
			con.addPacketListener(new ResourcePackListener(this, con));
			if(getConfig().getBoolean("skins.PEtoPC")) { con.addPacketListener(new SkinPacket().new decodeHandler(this, con)); }
			
		}
	}
	
	@Override
	public void onDisable() {
		pm("Bye world :O");
	}
	
{'fraction_non_alphanumeric': 0.10986159169550173, 'fraction_numerical': 0.0, 'mean_word_length': 6.340740740740741, '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': '4822778', 'n_tokens_mistral': 2150, 'n_tokens_neox': 1989, 'n_words': 361}