mirror of
https://e.coding.net/circlecloud/MiaoBoard.git
synced 2024-12-22 06:49:02 +00:00
fix: 修复自带替换工具错误
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
c87cc77d3a
commit
862c752d5f
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>MiaoBoard</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.4.2</version>
|
||||
<name>MiaoBoard</name>
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
|
@ -29,20 +29,22 @@ public class Replace {
|
||||
public static String $(final Player player, String text) {
|
||||
final Matcher m = PLACEHOLDER_PATTERN.matcher(text);
|
||||
while (m.find()) {
|
||||
final String k = m.group(1);
|
||||
if (k.contains("_")) {
|
||||
final String[] ka = k.split("_", 2);
|
||||
final String format = m.group(1);
|
||||
if (format.contains("_")) {
|
||||
final String[] ka = format.split("_", 2);
|
||||
String value = format;
|
||||
switch (ka[0]) {
|
||||
case "player":
|
||||
text = player(player, ka[1]);
|
||||
value = player(player, ka[1]);
|
||||
break;
|
||||
case "server":
|
||||
text = server(player, ka[1]);
|
||||
value = server(player, ka[1]);
|
||||
break;
|
||||
case "plugin":
|
||||
text = plugin(player, ka[1]);
|
||||
value = plugin(player, ka[1]);
|
||||
break;
|
||||
}
|
||||
text = text.replace("%" + format + "%", Matcher.quoteReplacement(value));
|
||||
}
|
||||
}
|
||||
return text;
|
||||
|
Loading…
Reference in New Issue
Block a user