Do not automatically color config strings (Fixes BUKKIT-1241)

This is necessary so that we still store the messages with the & code internally as they would get saved back to the config file using the converted color code (section sign) which could lead to encoding issues on different operating systems. (It also fixes issues with strings that contain an and sign that isn't supposed to be a color code) Instead we load the real string and color messages via the prefix method which should get called in every instance where a message is send.
This commit is contained in:
Phoenix616 2017-11-13 15:11:22 +01:00
parent 519a4fca8a
commit d332603fb4
2 changed files with 2 additions and 4 deletions

View File

@ -39,8 +39,6 @@ public class ValueParser {
}
return map;
} else if (object instanceof String) {
return Configuration.getColoured((String) object);
} else {
return object;
}

View File

@ -1,7 +1,7 @@
package com.Acrobot.ChestShop.Configuration;
import com.Acrobot.Breeze.Configuration.Annotations.PrecededBySpace;
import org.bukkit.ChatColor;
import com.Acrobot.Breeze.Configuration.Configuration;
/**
* @author Acrobot
@ -73,6 +73,6 @@ public class Messages {
public static String TOGGLE_MESSAGES_ON = "You will now receive messages from your shop(s).";
public static String prefix(String message) {
return prefix + message;
return Configuration.getColoured( prefix + message);
}
}