mirror of
				https://e.coding.net/circlecloud/YumCore.git
				synced 2025-11-03 23:06:02 +00:00 
			
		
		
		
	@@ -74,7 +74,7 @@ public abstract class AbstractInjectConfig {
 | 
			
		||||
        if (type.equals(String.class)) {
 | 
			
		||||
            value = ChatColor.translateAlternateColorCodes('&', String.valueOf(value));
 | 
			
		||||
        }
 | 
			
		||||
        if (!type.isAssignableFrom(value.getClass())) {
 | 
			
		||||
        if (value != null && !type.isAssignableFrom(value.getClass())) {
 | 
			
		||||
            Log.w("字段 %s 默认类型为 %s 但解析后为 %s 可能存在转换错误!", field.getName(), type.getName(), value.getClass().getName());
 | 
			
		||||
        }
 | 
			
		||||
        field.set(this, value);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ public class InjectParse {
 | 
			
		||||
    public static Object parse(Class type, Object value, ConfigurationSection config, String path) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
 | 
			
		||||
        if (allparse.containsKey(type)) { return allparse.get(type).parse(config, path); }
 | 
			
		||||
        try {
 | 
			
		||||
            return type.getDeclaredMethod("valueOf", String.class).invoke(null, value);
 | 
			
		||||
            return type.getDeclaredMethod("valueOf", String.class).invoke(null, String.valueOf(value));
 | 
			
		||||
        } catch (NoSuchMethodException | IllegalArgumentException ignored) {
 | 
			
		||||
        }
 | 
			
		||||
        if (InjectConfigurationSection.class.isAssignableFrom(type)) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user