fix: 解析特殊字符错误问题

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
2017-08-08 22:24:33 +08:00
parent d4f2c62d9b
commit 29a844dd7d
4 changed files with 49 additions and 6 deletions

View File

@@ -12,9 +12,8 @@ import pw.yumc.YumCore.bukkit.P;
import pw.yumc.YumCore.config.FileConfig;
/**
*
* @since 2016年9月9日 下午4:40:50
* @author 喵♂呜
* @since 2016年9月9日 下午4:40:50
*/
public class ChatConfig {
private static String F = "Formats";

View File

@@ -18,8 +18,8 @@ import pw.yumc.YumCore.tellraw.Tellraw;
/**
* 聊天规则
*
* @since 2016年9月9日 下午4:59:47
* @author 喵♂呜
* @since 2016年9月9日 下午4:59:47
*/
public class ChatRule extends InjectConfigurationSection {
private transient static MiaoChat plugin = P.getPlugin();
@@ -117,7 +117,7 @@ public class ChatRule extends InjectConfigurationSection {
}
String tempvar = format;
for (String var : temp) {
String[] args = tempvar.split("\\[" + var + "]", 2);
String[] args = tempvar.split(Pattern.quote("[" + var + "]"), 2);
if (!"".equals(args[0])) {
formats.add(args[0]);
}