// Path: src/main/java/cn/jiongjionger/neverlag/utils/Reflection.java
// public interface FieldAccessor<T> {
// 	/**
// 	 * Retrieve the content of a field.
// 	 *
// 	 * @param target the target object, or NULL for a static field.
// 	 * @return The value of the field.
// 	 */
// 	T get(Object target);
// 
// 	/**
// 	 * Determine if the given object has this field.
// 	 *
// 	 * @param target the object to test.
// 	 * @return TRUE if it does, FALSE otherwise.
// 	 */
// 	boolean hasField(Object target);
// 
// 	/**
// 	 * Set the content of a field.
// 	 *
// 	 * @param target the target object, or NULL for a static field.
// 	 * @param value  the new value of the field.
// 	 */
// 	void set(Object target, Object value);
// }
// 
// Path: src/main/java/cn/jiongjionger/neverlag/utils/Reflection.java
// public interface MethodInvoker {
// 	/**
// 	 * Invoke a method on a specific target object.
// 	 *
// 	 * @param target    - the target object, or NULL for a static method.
// 	 * @param arguments - the arguments to pass to the method.
// 	 * @return The return value, or NULL if is void.
// 	 */
// 	Object invoke(Object target, Object... arguments);
// }


import cn.jiongjionger.neverlag.utils.Reflection.FieldAccessor;
import cn.jiongjionger.neverlag.utils.Reflection.MethodInvoker;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.LinkedHashMap;
package cn.jiongjionger.neverlag.utils;



public final class PingUtils {
	private static final MethodInvoker method_getHandle;
	private static final FieldAccessor<Integer> field_ping;

	static {
		method_getHandle = Reflection.getMethod(Reflection.getCraftBukkitClass("entity.CraftEntity"), "getHandle");
		field_ping = Reflection.getField(Reflection.getMinecraftClass("EntityPlayer"), "ping", int.class);
	}

	// 给延迟标注颜色
	public static String colorPing(int ping) {
		StringBuilder sb = new StringBuilder();
		if (ping <= 80) {
			sb.append(ChatColor.GREEN);
		} else if (ping <= 110) {
			sb.append(ChatColor.DARK_GREEN);
// Path: src/main/java/cn/jiongjionger/neverlag/utils/Reflection.java
// public interface FieldAccessor<T> {
// 	/**
// 	 * Retrieve the content of a field.
// 	 *
// 	 * @param target the target object, or NULL for a static field.
// 	 * @return The value of the field.
// 	 */
// 	T get(Object target);
// 
// 	/**
// 	 * Determine if the given object has this field.
// 	 *
// 	 * @param target the object to test.
// 	 * @return TRUE if it does, FALSE otherwise.
// 	 */
// 	boolean hasField(Object target);
// 
// 	/**
// 	 * Set the content of a field.
// 	 *
// 	 * @param target the target object, or NULL for a static field.
// 	 * @param value  the new value of the field.
// 	 */
// 	void set(Object target, Object value);
// }
// 
// Path: src/main/java/cn/jiongjionger/neverlag/utils/Reflection.java
// public interface MethodInvoker {
// 	/**
// 	 * Invoke a method on a specific target object.
// 	 *
// 	 * @param target    - the target object, or NULL for a static method.
// 	 * @param arguments - the arguments to pass to the method.
// 	 * @return The return value, or NULL if is void.
// 	 */
// 	Object invoke(Object target, Object... arguments);
// }


// Path: src/main/java/cn/jiongjionger/neverlag/utils/PingUtils.java
import cn.jiongjionger.neverlag.utils.Reflection.FieldAccessor;
import cn.jiongjionger.neverlag.utils.Reflection.MethodInvoker;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.LinkedHashMap;

package cn.jiongjionger.neverlag.utils;



public final class PingUtils {
	private static final MethodInvoker method_getHandle;
	private static final FieldAccessor<Integer> field_ping;

	static {
		method_getHandle = Reflection.getMethod(Reflection.getCraftBukkitClass("entity.CraftEntity"), "getHandle");
		field_ping = Reflection.getField(Reflection.getMinecraftClass("EntityPlayer"), "ping", int.class);
	}

	// 给延迟标注颜色
	public static String colorPing(int ping) {
		StringBuilder sb = new StringBuilder();
		if (ping <= 80) {
			sb.append(ChatColor.GREEN);
		} else if (ping <= 110) {
			sb.append(ChatColor.DARK_GREEN);
		} else if (ping <= 165) {