<commit_before>package com.vxnick.areatp;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;

import net.milkbowl.vault.permission.Permission;

import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public final class AreaTP extends JavaPlugin {
    public static Permission perms = null;

	@Override
	public void onEnable() {
		RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
        perms = rsp.getProvider();
        
        saveDefaultConfig();
    }
	
	@Override
	public void onDisable() {
		
	}
	
	public void paginate(CommandSender sender, SortedMap<Integer, String> map, int page, int pageLength) {
		int maxPages = (((map.size() % pageLength) == 0) ? map.size() / pageLength : (map.size() / pageLength) + 1);
		
		if (page > maxPages) {
			page = maxPages;
		}
		
	    sender.sendMessage(ChatColor.YELLOW + "Page " + String.valueOf(page) + " of " + maxPages + ChatColor.RESET);
	    
	    int i = 0, k = 0;
	    page--;
	    
	    for (final Entry<Integer, String> e : map.entrySet()) {
	        k++;
	        if ((((page * pageLength) + i + 1) == k) && (k != ((page * pageLength) + pageLength + 1))) {
	            i++;
	            sender.sendMessage(e.getValue());
	        }
	    }
	}
	
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
		if (cmd.getName().equalsIgnoreCase("atp")) {
			if (!perms.has(sender, "areatp.use")) {
				sender.sendMessage(ChatColor.RED + "Sorry, you don't have access to areaTP");
				return true;
			}
			
			String command;
			
			if (args.length > 0) {
				command = args[0].toLowerCase();
			} else {
				// Show owned area teleports<commit_msg>Fix space indents<commit_after>package com.vxnick.areatp;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;

import net.milkbowl.vault.permission.Permission;

import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public final class AreaTP extends JavaPlugin {
	public static Permission perms = null;

	@Override
	public void onEnable() {
		RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
		perms = rsp.getProvider();
		
		saveDefaultConfig();
	}
	
	@Override
	public void onDisable() {
		
	}
	
	public void paginate(CommandSender sender, SortedMap<Integer, String> map, int page, int pageLength) {
		int maxPages = (((map.size() % pageLength) == 0) ? map.size() / pageLength : (map.size() / pageLength) + 1);
		
		if (page > maxPages) {
			page = maxPages;
		}
		
		sender.sendMessage(ChatColor.YELLOW + "Page " + String.valueOf(page) + " of " + maxPages + ChatColor.RESET);
		
		int i = 0, k = 0;
		page--;
		
		for (final Entry<Integer, String> e : map.entrySet()) {
			k++;
			if ((((page * pageLength) + i + 1) == k) && (k != ((page * pageLength) + pageLength + 1))) {
				i++;
				sender.sendMessage(e.getValue());
			}
		}
	}
	
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
		if (cmd.getName().equalsIgnoreCase("atp")) {
			if (!perms.has(sender, "areatp.use")) {
				sender.sendMessage(ChatColor.RED + "Sorry, you don't have access to areaTP");
				return true;
			}
			
			String command;
			
			if (args.length > 0) {
				command = args[0].toLowerCase();
			} else {
				// Show owned area teleports
{'fraction_non_alphanumeric': 0.13536795471326607, 'fraction_numerical': 0.0039379768643859215, 'mean_word_length': 3.5972850678733033, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '4312344', 'n_tokens_mistral': 1446, 'n_tokens_neox': 1271, 'n_words': 305}