diff --git a/pom.xml b/pom.xml
index 82b2e5a..efcbc99 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
pw.yumc
MiaoChat
- 1.5
+ 1.5.1
${project.name}
diff --git a/src/main/java/pw/yumc/MiaoChat/config/ChatRule.java b/src/main/java/pw/yumc/MiaoChat/config/ChatRule.java
index 653a1f5..23434da 100644
--- a/src/main/java/pw/yumc/MiaoChat/config/ChatRule.java
+++ b/src/main/java/pw/yumc/MiaoChat/config/ChatRule.java
@@ -18,7 +18,7 @@ import pw.yumc.YumCore.config.inject.InjectConfigurationSection;
* @author 喵♂呜
*/
public class ChatRule extends InjectConfigurationSection {
- private transient static Pattern FORMAT_PATTERN = Pattern.compile("[\\[]([^\\[\\]]+)[\\]]");
+ private transient static Pattern FORMAT_PATTERN = Pattern.compile("[\\[]([^\\[\\]]+)[]]");
private transient String name;
@Default("50")
private Integer index;
@@ -43,7 +43,7 @@ public class ChatRule extends InjectConfigurationSection {
}
formats = new LinkedList<>();
load();
- lastColor = ChatColor.getLastColors(ChatColor.translateAlternateColorCodes('&', formats.getLast()));
+ lastColor = ChatColor.getLastColors(ChatColor.translateAlternateColorCodes('&', formats.isEmpty() ? "§r" : formats.getLast()));
}
public boolean check(Player player) {
@@ -99,7 +99,7 @@ public class ChatRule extends InjectConfigurationSection {
String tempvar = format;
if (!temp.isEmpty()) {
for (String var : temp) {
- String[] args = tempvar.split("\\[" + var + "\\]", 2);
+ String[] args = tempvar.split("\\[" + var + "]", 2);
if (!"".equals(args[0])) {
formats.add(args[0]);
}