mirror of
				https://e.coding.net/circlecloud/YumCore.git
				synced 2025-11-03 23:06:02 +00:00 
			
		
		
		
	
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							@@ -4,7 +4,7 @@
 | 
				
			|||||||
    <modelVersion>4.0.0</modelVersion>
 | 
					    <modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
    <groupId>pw.yumc</groupId>
 | 
					    <groupId>pw.yumc</groupId>
 | 
				
			||||||
    <artifactId>YumCore</artifactId>
 | 
					    <artifactId>YumCore</artifactId>
 | 
				
			||||||
    <version>1.5</version>
 | 
					    <version>1.6</version>
 | 
				
			||||||
    <build>
 | 
					    <build>
 | 
				
			||||||
        <finalName>${project.artifactId}</finalName>
 | 
					        <finalName>${project.artifactId}</finalName>
 | 
				
			||||||
        <resources>
 | 
					        <resources>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,9 +32,11 @@ public class Log {
 | 
				
			|||||||
     * Typically the root Logger is configured with a set of Handlers
 | 
					     * Typically the root Logger is configured with a set of Handlers
 | 
				
			||||||
     * that essentially act as default handlers for all loggers.
 | 
					     * that essentially act as default handlers for all loggers.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param handler a logging Handler
 | 
					     * @param handler
 | 
				
			||||||
     * @throws SecurityException if a security manager exists and if
 | 
					     *            a logging Handler
 | 
				
			||||||
     *                           the caller does not have LoggingPermission("control").
 | 
					     * @throws SecurityException
 | 
				
			||||||
 | 
					     *             if a security manager exists and if
 | 
				
			||||||
 | 
					     *             the caller does not have LoggingPermission("control").
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void addHandler(Handler handler) throws SecurityException {
 | 
					    public static void addHandler(Handler handler) throws SecurityException {
 | 
				
			||||||
        logger.addHandler(handler);
 | 
					        logger.addHandler(handler);
 | 
				
			||||||
@@ -43,7 +45,8 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sends console a message
 | 
					     * Sends console a message
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param message Message to be displayed
 | 
					     * @param message
 | 
				
			||||||
 | 
					     *            Message to be displayed
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void console(String message) {
 | 
					    public static void console(String message) {
 | 
				
			||||||
        console.sendMessage(prefix + message);
 | 
					        console.sendMessage(prefix + message);
 | 
				
			||||||
@@ -52,8 +55,10 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sends console a message
 | 
					     * Sends console a message
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param message 消息
 | 
					     * @param message
 | 
				
			||||||
     * @param object  格式化参数
 | 
					     *            消息
 | 
				
			||||||
 | 
					     * @param object
 | 
				
			||||||
 | 
					     *            格式化参数
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void console(String message, Object... object) {
 | 
					    public static void console(String message, Object... object) {
 | 
				
			||||||
        console.sendMessage(prefix + String.format(message, object));
 | 
					        console.sendMessage(prefix + String.format(message, object));
 | 
				
			||||||
@@ -62,7 +67,8 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sends console a message
 | 
					     * Sends console a message
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param msg Message to be displayed
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            Message to be displayed
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void console(String[] msg) {
 | 
					    public static void console(String[] msg) {
 | 
				
			||||||
        for (String str : msg) {
 | 
					        for (String str : msg) {
 | 
				
			||||||
@@ -73,45 +79,35 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 调试消息
 | 
					     * 调试消息
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param msg    消息
 | 
					     * @param msg
 | 
				
			||||||
     * @param object 参数
 | 
					     *            消息
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public static void d(String msg) {
 | 
				
			||||||
 | 
					        if (debug) {
 | 
				
			||||||
 | 
					            logger.info("[DEBUG] " + msg);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 调试消息
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            消息
 | 
				
			||||||
 | 
					     * @param object
 | 
				
			||||||
 | 
					     *            参数
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void d(String msg, Object... object) {
 | 
					    public static void d(String msg, Object... object) {
 | 
				
			||||||
        debug(String.format(msg, object));
 | 
					        d(String.format(msg, object));
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * 格式化调试消息
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param msg 消息
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static void debug(String msg) {
 | 
					 | 
				
			||||||
        if (debug) {
 | 
					 | 
				
			||||||
            logger.info("[DEBUG] " + msg);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 调试消息
 | 
					     * 调试消息
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param msg    消息
 | 
					     * @param e
 | 
				
			||||||
     * @param object 参数
 | 
					     *            异常
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void debug(String msg, Object... object) {
 | 
					    public static void d(Throwable e) {
 | 
				
			||||||
        if (debug) {
 | 
					        if (debug) {
 | 
				
			||||||
            logger.log(Level.SEVERE, "[DEBUG] " + msg, object);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * 调试消息
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param msg 消息
 | 
					 | 
				
			||||||
     * @param e   异常
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static void d(String msg, Throwable e) {
 | 
					 | 
				
			||||||
        if (debug) {
 | 
					 | 
				
			||||||
            logger.info("[DEBUG] " + msg);
 | 
					 | 
				
			||||||
            e.printStackTrace();
 | 
					            e.printStackTrace();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -119,10 +115,14 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 调试消息
 | 
					     * 调试消息
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param e 异常
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            消息
 | 
				
			||||||
 | 
					     * @param e
 | 
				
			||||||
 | 
					     *            异常
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void d(Throwable e) {
 | 
					    public static void d(String msg, Throwable e) {
 | 
				
			||||||
        if (debug) {
 | 
					        if (debug) {
 | 
				
			||||||
 | 
					            logger.info("[DEBUG] " + msg);
 | 
				
			||||||
            e.printStackTrace();
 | 
					            e.printStackTrace();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -134,22 +134,12 @@ public class Log {
 | 
				
			|||||||
        return prefix;
 | 
					        return prefix;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void i(String msg, Object... objs) {
 | 
					    public static void i(String msg) {
 | 
				
			||||||
        logger.info(String.format(msg, objs));
 | 
					        logger.info(msg);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    public static void i(String msg, Object... objs) {
 | 
				
			||||||
     * Log an INFO message.
 | 
					        logger.info(String.format(msg, objs));
 | 
				
			||||||
     * <p>
 | 
					 | 
				
			||||||
     * If the logger is currently enabled for the INFO message
 | 
					 | 
				
			||||||
     * level then the given message is forwarded to all the
 | 
					 | 
				
			||||||
     * registered output Handler objects.
 | 
					 | 
				
			||||||
     * <p>
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param msg The string message (or a key in the message catalog)
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static void info(String msg) {
 | 
					 | 
				
			||||||
        logger.info(msg);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -160,8 +150,10 @@ public class Log {
 | 
				
			|||||||
     * registered output Handler objects.
 | 
					     * registered output Handler objects.
 | 
				
			||||||
     * <p>
 | 
					     * <p>
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param level One of the message level identifiers, e.g., SEVERE
 | 
					     * @param level
 | 
				
			||||||
     * @param msg   The string message (or a key in the message catalog)
 | 
					     *            One of the message level identifiers, e.g., SEVERE
 | 
				
			||||||
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            The string message (or a key in the message catalog)
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void log(Level level, String msg) {
 | 
					    public static void log(Level level, String msg) {
 | 
				
			||||||
        logger.log(level, msg);
 | 
					        logger.log(level, msg);
 | 
				
			||||||
@@ -175,9 +167,12 @@ public class Log {
 | 
				
			|||||||
     * to all the registered output Handler objects.
 | 
					     * to all the registered output Handler objects.
 | 
				
			||||||
     * <p>
 | 
					     * <p>
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param level  One of the message level identifiers, e.g., SEVERE
 | 
					     * @param level
 | 
				
			||||||
     * @param msg    The string message (or a key in the message catalog)
 | 
					     *            One of the message level identifiers, e.g., SEVERE
 | 
				
			||||||
     * @param param1 parameter to the message
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            The string message (or a key in the message catalog)
 | 
				
			||||||
 | 
					     * @param param1
 | 
				
			||||||
 | 
					     *            parameter to the message
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void log(Level level, String msg, Object param1) {
 | 
					    public static void log(Level level, String msg, Object param1) {
 | 
				
			||||||
        logger.log(level, msg, param1);
 | 
					        logger.log(level, msg, param1);
 | 
				
			||||||
@@ -191,9 +186,12 @@ public class Log {
 | 
				
			|||||||
     * to all the registered output Handler objects.
 | 
					     * to all the registered output Handler objects.
 | 
				
			||||||
     * <p>
 | 
					     * <p>
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param level  One of the message level identifiers, e.g., SEVERE
 | 
					     * @param level
 | 
				
			||||||
     * @param msg    The string message (or a key in the message catalog)
 | 
					     *            One of the message level identifiers, e.g., SEVERE
 | 
				
			||||||
     * @param params array of parameters to the message
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            The string message (or a key in the message catalog)
 | 
				
			||||||
 | 
					     * @param params
 | 
				
			||||||
 | 
					     *            array of parameters to the message
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void log(Level level, String msg, Object[] params) {
 | 
					    public static void log(Level level, String msg, Object[] params) {
 | 
				
			||||||
        logger.log(level, msg, params);
 | 
					        logger.log(level, msg, params);
 | 
				
			||||||
@@ -212,16 +210,20 @@ public class Log {
 | 
				
			|||||||
     * as a formatting parameter to the LogRecord message property.
 | 
					     * as a formatting parameter to the LogRecord message property.
 | 
				
			||||||
     * <p>
 | 
					     * <p>
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param level  One of the message level identifiers, e.g., SEVERE
 | 
					     * @param level
 | 
				
			||||||
     * @param msg    The string message (or a key in the message catalog)
 | 
					     *            One of the message level identifiers, e.g., SEVERE
 | 
				
			||||||
     * @param thrown Throwable associated with log message.
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            The string message (or a key in the message catalog)
 | 
				
			||||||
 | 
					     * @param thrown
 | 
				
			||||||
 | 
					     *            Throwable associated with log message.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void log(Level level, String msg, Throwable thrown) {
 | 
					    public static void log(Level level, String msg, Throwable thrown) {
 | 
				
			||||||
        logger.log(level, msg, thrown);
 | 
					        logger.log(level, msg, thrown);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @param prefix 插件前缀
 | 
					     * @param prefix
 | 
				
			||||||
 | 
					     *            插件前缀
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void setPrefix(String prefix) {
 | 
					    public static void setPrefix(String prefix) {
 | 
				
			||||||
        Log.prefix = ChatColor.translateAlternateColorCodes('&', prefix);
 | 
					        Log.prefix = ChatColor.translateAlternateColorCodes('&', prefix);
 | 
				
			||||||
@@ -232,7 +234,8 @@ public class Log {
 | 
				
			|||||||
     * <p>
 | 
					     * <p>
 | 
				
			||||||
     * If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered output Handler objects.
 | 
					     * If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered output Handler objects.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param msg The string message (or a key in the message catalog)
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            The string message (or a key in the message catalog)
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void severe(String msg) {
 | 
					    public static void severe(String msg) {
 | 
				
			||||||
        logger.severe(msg);
 | 
					        logger.severe(msg);
 | 
				
			||||||
@@ -241,8 +244,10 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sends this sender a message
 | 
					     * Sends this sender a message
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param sender 命令发送者
 | 
					     * @param sender
 | 
				
			||||||
     * @param msg    消息
 | 
					     *            命令发送者
 | 
				
			||||||
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            消息
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void sender(CommandSender sender, String msg) {
 | 
					    public static void sender(CommandSender sender, String msg) {
 | 
				
			||||||
        sender.sendMessage(prefix + msg);
 | 
					        sender.sendMessage(prefix + msg);
 | 
				
			||||||
@@ -251,9 +256,12 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sends this sender a message
 | 
					     * Sends this sender a message
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param sender 命令发送者
 | 
					     * @param sender
 | 
				
			||||||
     * @param msg    消息
 | 
					     *            命令发送者
 | 
				
			||||||
     * @param objs   参数
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            消息
 | 
				
			||||||
 | 
					     * @param objs
 | 
				
			||||||
 | 
					     *            参数
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void sender(CommandSender sender, String msg, Object... objs) {
 | 
					    public static void sender(CommandSender sender, String msg, Object... objs) {
 | 
				
			||||||
        sender.sendMessage(prefix + String.format(msg, objs));
 | 
					        sender.sendMessage(prefix + String.format(msg, objs));
 | 
				
			||||||
@@ -262,8 +270,10 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sends this sender a message
 | 
					     * Sends this sender a message
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param sender 命令发送者
 | 
					     * @param sender
 | 
				
			||||||
     * @param msg    消息
 | 
					     *            命令发送者
 | 
				
			||||||
 | 
					     * @param msg
 | 
				
			||||||
 | 
					     *            消息
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void sender(CommandSender sender, String[] msg) {
 | 
					    public static void sender(CommandSender sender, String[] msg) {
 | 
				
			||||||
        for (String str : msg) {
 | 
					        for (String str : msg) {
 | 
				
			||||||
@@ -274,25 +284,22 @@ public class Log {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 格式化警告消息
 | 
					     * 格式化警告消息
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param string  消息
 | 
					     * @param string
 | 
				
			||||||
     * @param objects 参数
 | 
					     *            消息
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public static void w(String string) {
 | 
				
			||||||
 | 
					        logger.warning(string);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 格式化警告消息
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param string
 | 
				
			||||||
 | 
					     *            消息
 | 
				
			||||||
 | 
					     * @param objects
 | 
				
			||||||
 | 
					     *            参数
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void w(String string, Object... objects) {
 | 
					    public static void w(String string, Object... objects) {
 | 
				
			||||||
        logger.warning(String.format(string, objects));
 | 
					        logger.warning(String.format(string, objects));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Log a WARNING message.
 | 
					 | 
				
			||||||
     * <p>
 | 
					 | 
				
			||||||
     * If the logger is currently enabled for the WARNING message
 | 
					 | 
				
			||||||
     * level then the given message is forwarded to all the
 | 
					 | 
				
			||||||
     * registered output Handler objects.
 | 
					 | 
				
			||||||
     * <p>
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param msg The string message (or a key in the message catalog)
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static void warning(String msg) {
 | 
					 | 
				
			||||||
        logger.warning(msg);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,10 @@ import java.lang.annotation.Target;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 扩展选项注解
 | 
					 * 扩展选项注解
 | 
				
			||||||
 *
 | 
					 * <code>
 | 
				
			||||||
 | 
					 *     例如 "def:默认值 max:最大值 min 最小值"
 | 
				
			||||||
 | 
					 *</code>
 | 
				
			||||||
 | 
					 * 
 | 
				
			||||||
 * @since 2016年7月23日 上午9:00:07
 | 
					 * @since 2016年7月23日 上午9:00:07
 | 
				
			||||||
 * @author 喵♂呜
 | 
					 * @author 喵♂呜
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,16 +1,26 @@
 | 
				
			|||||||
package pw.yumc.YumCore.config;
 | 
					package pw.yumc.YumCore.config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.io.File;
 | 
				
			||||||
 | 
					import java.io.FileInputStream;
 | 
				
			||||||
 | 
					import java.io.FileNotFoundException;
 | 
				
			||||||
 | 
					import java.io.IOException;
 | 
				
			||||||
 | 
					import java.io.InputStream;
 | 
				
			||||||
 | 
					import java.io.InputStreamReader;
 | 
				
			||||||
 | 
					import java.text.SimpleDateFormat;
 | 
				
			||||||
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					import java.util.Collections;
 | 
				
			||||||
 | 
					import java.util.Date;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import java.util.Set;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.apache.commons.lang.Validate;
 | 
					import org.apache.commons.lang.Validate;
 | 
				
			||||||
import org.bukkit.ChatColor;
 | 
					import org.bukkit.ChatColor;
 | 
				
			||||||
import org.bukkit.Location;
 | 
					import org.bukkit.Location;
 | 
				
			||||||
import org.bukkit.configuration.InvalidConfigurationException;
 | 
					import org.bukkit.configuration.InvalidConfigurationException;
 | 
				
			||||||
import org.bukkit.configuration.MemorySection;
 | 
					import org.bukkit.configuration.MemorySection;
 | 
				
			||||||
import org.bukkit.configuration.file.YamlConfiguration;
 | 
					import org.bukkit.configuration.file.YamlConfiguration;
 | 
				
			||||||
import pw.yumc.YumCore.bukkit.Log;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.*;
 | 
					import pw.yumc.YumCore.bukkit.Log;
 | 
				
			||||||
import java.text.SimpleDateFormat;
 | 
					 | 
				
			||||||
import java.util.*;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 一个继承于 {@link YamlConfiguration} 的配置文件类
 | 
					 * 一个继承于 {@link YamlConfiguration} 的配置文件类
 | 
				
			||||||
@@ -20,7 +30,6 @@ import java.util.*;
 | 
				
			|||||||
 * @version 1.0
 | 
					 * @version 1.0
 | 
				
			||||||
 * @since 2015年11月7日 下午2:36:07
 | 
					 * @since 2015年11月7日 下午2:36:07
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@SuppressWarnings({ "unchecked" })
 | 
					 | 
				
			||||||
public class FileConfig extends AbstractConfig {
 | 
					public class FileConfig extends AbstractConfig {
 | 
				
			||||||
    protected static String VERSION = "Version";
 | 
					    protected static String VERSION = "Version";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -277,7 +286,7 @@ public class FileConfig extends AbstractConfig {
 | 
				
			|||||||
            commentConfig = new CommentConfig();
 | 
					            commentConfig = new CommentConfig();
 | 
				
			||||||
            commentConfig.loadFromString(contents);
 | 
					            commentConfig.loadFromString(contents);
 | 
				
			||||||
        } catch (Exception e) {
 | 
					        } catch (Exception e) {
 | 
				
			||||||
            Log.debug(CONFIG_READ_COMMENT_ERROR);
 | 
					            Log.d(CONFIG_READ_COMMENT_ERROR);
 | 
				
			||||||
            commentConfig = null;
 | 
					            commentConfig = null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        super.loadFromString(contents);
 | 
					        super.loadFromString(contents);
 | 
				
			||||||
@@ -516,7 +525,7 @@ public class FileConfig extends AbstractConfig {
 | 
				
			|||||||
        try {
 | 
					        try {
 | 
				
			||||||
            init(new FileInputStream(file));
 | 
					            init(new FileInputStream(file));
 | 
				
			||||||
        } catch (FileNotFoundException e) {
 | 
					        } catch (FileNotFoundException e) {
 | 
				
			||||||
            Log.debug(String.format(CONFIG_NOT_FOUND, file.toPath()));
 | 
					            Log.d(CONFIG_NOT_FOUND, file.toPath());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return this;
 | 
					        return this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -603,7 +612,7 @@ public class FileConfig extends AbstractConfig {
 | 
				
			|||||||
                if (newVer != null && !newVer.getClass().equals(var.getClass())) {
 | 
					                if (newVer != null && !newVer.getClass().equals(var.getClass())) {
 | 
				
			||||||
                    Log.w("警告! 旧数据类型与新配置类型不匹配!");
 | 
					                    Log.w("警告! 旧数据类型与新配置类型不匹配!");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                Log.debug(String.format(CONFIG_UPDATE_VALUE, string, var));
 | 
					                Log.d(CONFIG_UPDATE_VALUE, string, var);
 | 
				
			||||||
                newCfg.set(string, var);
 | 
					                newCfg.set(string, var);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,19 @@
 | 
				
			|||||||
package pw.yumc.YumCore.sql;
 | 
					package pw.yumc.YumCore.sql;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.sql.Connection;
 | 
				
			||||||
 | 
					import java.sql.DatabaseMetaData;
 | 
				
			||||||
 | 
					import java.sql.PreparedStatement;
 | 
				
			||||||
 | 
					import java.sql.ResultSet;
 | 
				
			||||||
 | 
					import java.sql.SQLException;
 | 
				
			||||||
 | 
					import java.sql.Statement;
 | 
				
			||||||
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					import java.util.Collection;
 | 
				
			||||||
 | 
					import java.util.LinkedList;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.bukkit.configuration.ConfigurationSection;
 | 
					import org.bukkit.configuration.ConfigurationSection;
 | 
				
			||||||
import org.bukkit.plugin.Plugin;
 | 
					import org.bukkit.plugin.Plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import pw.yumc.YumCore.bukkit.Log;
 | 
					import pw.yumc.YumCore.bukkit.Log;
 | 
				
			||||||
import pw.yumc.YumCore.bukkit.P;
 | 
					import pw.yumc.YumCore.bukkit.P;
 | 
				
			||||||
import pw.yumc.YumCore.config.inject.InjectParse;
 | 
					import pw.yumc.YumCore.config.inject.InjectParse;
 | 
				
			||||||
@@ -11,12 +23,6 @@ import pw.yumc.YumCore.sql.core.KeyValue;
 | 
				
			|||||||
import pw.yumc.YumCore.sql.core.MySQLCore;
 | 
					import pw.yumc.YumCore.sql.core.MySQLCore;
 | 
				
			||||||
import pw.yumc.YumCore.sql.core.SQLiteCore;
 | 
					import pw.yumc.YumCore.sql.core.SQLiteCore;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.sql.*;
 | 
					 | 
				
			||||||
import java.util.ArrayList;
 | 
					 | 
				
			||||||
import java.util.Collection;
 | 
					 | 
				
			||||||
import java.util.LinkedList;
 | 
					 | 
				
			||||||
import java.util.List;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 数据库管理类
 | 
					 * 数据库管理类
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
@@ -467,7 +473,7 @@ public class DataBase {
 | 
				
			|||||||
    public void sqlerr(String sql, Exception e) {
 | 
					    public void sqlerr(String sql, Exception e) {
 | 
				
			||||||
        info("数据库操作出错: " + e.getMessage());
 | 
					        info("数据库操作出错: " + e.getMessage());
 | 
				
			||||||
        info("SQL查询语句: " + sql);
 | 
					        info("SQL查询语句: " + sql);
 | 
				
			||||||
        Log.debug(this.getClass().getName());
 | 
					        Log.d(this.getClass().getName());
 | 
				
			||||||
        Log.d(e);
 | 
					        Log.d(e);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,10 @@
 | 
				
			|||||||
package pw.yumc.YumCore.sql.core;
 | 
					package pw.yumc.YumCore.sql.core;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.sql.*;
 | 
					import java.sql.Connection;
 | 
				
			||||||
 | 
					import java.sql.PreparedStatement;
 | 
				
			||||||
 | 
					import java.sql.ResultSet;
 | 
				
			||||||
 | 
					import java.sql.SQLException;
 | 
				
			||||||
 | 
					import java.sql.Statement;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import pw.yumc.YumCore.bukkit.Log;
 | 
					import pw.yumc.YumCore.bukkit.Log;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -150,7 +154,7 @@ public abstract class DataBaseCore {
 | 
				
			|||||||
     *            SQL语句
 | 
					     *            SQL语句
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    private void debug(String sql) {
 | 
					    private void debug(String sql) {
 | 
				
			||||||
        Log.debug("[SQL] " + sql);
 | 
					        Log.d("[SQL] " + sql);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user