@@ -0,0 +1,1583 @@
+package info.u_team.u_team_core.util;%0A%0Aimport java.lang.reflect.Field;%0A%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0A%0Aimport net.minecraftforge.fml.util.ObfuscationReflectionHelper;%0A%0Apublic class ReflectionUtil %7B%0A%09%0A%09private static final Logger LOGGER = LogManager.getLogger();%0A%09%0A%09public static Field findField(Class%3C?%3E clazz, String field) %7B%0A%09%09return ObfuscationReflectionHelper.findField(clazz, field);%0A%09%7D%0A%09%0A%09public static %3CI, V%3E void setValue(Field field, I instance, V value) %7B%0A%09%09try %7B%0A%09%09%09field.set(instance, value);%0A%09%09%7D catch (IllegalArgumentException %7C IllegalAccessException ex) %7B%0A%09%09%09var exception = new AccessFieldException(%22%22, ex);%0A%09%09%09LOGGER.error(%22Unable to set any field %7B%7D on type %7B%7D%22, field.getName(), field.getDeclaringClass(), exception);%0A%09%09%09throw exception;%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static %3CI, V%3E V getValue(Field field, I instance) %7B%0A%09%09try %7B%0A%09%09%09return CastUtil.uncheckedCast(field.get(instance));%0A%09%09%7D catch (IllegalArgumentException %7C IllegalAccessException ex) %7B%0A%09%09%09var exception = new AccessFieldException(%22%22, ex);%0A%09%09%09LOGGER.error(%22Unable to access field %7B%7D on type %7B%7D%22, field.getName(), field.getDeclaringClass(), exception);%0A%09%09%09throw exception;%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static %3CO, N%3E void copyValue(Field field, O oldInstance, N newInstance) %7B%0A%09%09setValue(field, newInstance, getValue(field, oldInstance));%0A%09%7D%0A%09%0A%09private static class AccessFieldException extends RuntimeException %7B%0A%09%09%0A%09%09private static final long serialVersionUID = 1L;%0A%09%09%0A%09%09public AccessFieldException(String message, Throwable cause) %7B%0A%09%09%09super(message, cause);%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

Add reflection util