Skip to content

Commit c8bcf82

Browse files
authored
Merge pull request #17 from box3lab/dev_coolfish
feat(command): 更新地图文件名解析逻辑
2 parents 3dc7351 + 7724058 commit c8bcf82

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/main/java/com/box3lab/command/ModCommands.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,10 @@ private static int listBox3ImportFiles(CommandSourceStack source) {
124124
}
125125

126126
private static String resolveMapName(String fileName) {
127-
if (fileName != null && fileName.startsWith("Box3Build-")) {
128-
129-
String suffix = fileName.substring("Box3Build-".length());
127+
if (fileName != null && fileName.startsWith("Box3-")) {
128+
String suffix = fileName.substring("Box3-".length());
130129
if (!suffix.isEmpty()) {
131-
boolean allDigits = true;
132-
for (int i = 0; i < suffix.length(); i++) {
133-
if (!Character.isDigit(suffix.charAt(i))) {
134-
allDigits = false;
135-
break;
136-
}
137-
}
138-
if (allDigits) {
139-
return "https://static.pgaot.com/MC/Build/" + suffix + ".gz";
140-
}
130+
return "https://static.pgaot.com/mc/build/" + suffix + ".gz";
141131
}
142132
}
143133
return fileName;

0 commit comments

Comments
 (0)