Skip to content

Commit

Permalink
1.1.4 修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
handy-git committed Jun 30, 2024
1 parent 8c6ae1e commit 178a204
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<groupId>cn.handyplus.region</groupId>
<artifactId>ip2region</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spigot-api.vesion>1.21-R0.1-SNAPSHOT</spigot-api.vesion>
<lombok.version>1.18.32</lombok.version>
<HandyLib.version>3.10.0</HandyLib.version>
<HandyLib.version>3.10.1</HandyLib.version>
<ip2region.version>2.7.0</ip2region.version>
<placeholderapi.version>2.10.5</placeholderapi.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/handyplus/region/Ip2region.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void onEnable() {
.checkVersion(ConfigUtil.CONFIG.getBoolean(BaseConstants.IS_CHECK_UPDATE), BaseIpConstants.PLUGIN_VERSION_URL);

MessageUtil.sendConsoleMessage("§a已成功载入服务器!");
MessageUtil.sendConsoleMessage("§aAuthor:handy 使用文档: https://ricedoc.handyplus.cn/wiki/ip2region/README/");
MessageUtil.sendConsoleMessage("§aAuthor:handy WIKI: https://ricedoc.handyplus.cn/wiki/ip2region/README/");
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/cn/handyplus/region/api/Ip2regionApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static String getNational(String ip) {
if (StrUtil.isEmpty(region)) {
return BaseIpConstants.UNKNOWN;
}
List<String> list = StrUtil.strToStrList(region, "|");
List<String> list = StrUtil.strToStrList(region, "\\|");
String national = list.get(0);
return "0".equals(national) ? BaseIpConstants.UNKNOWN : national;
}
Expand All @@ -55,7 +55,7 @@ public static String getProvincial(String ip) {
if (StrUtil.isEmpty(region)) {
return BaseIpConstants.UNKNOWN;
}
List<String> list = StrUtil.strToStrList(region, "|");
List<String> list = StrUtil.strToStrList(region, "\\|");
String provincial = list.get(2);
return "0".equals(provincial) ? BaseIpConstants.UNKNOWN : provincial;
}
Expand All @@ -71,7 +71,7 @@ public static String getMunicipal(String ip) {
if (StrUtil.isEmpty(region)) {
return BaseIpConstants.UNKNOWN;
}
List<String> list = StrUtil.strToStrList(region, "|");
List<String> list = StrUtil.strToStrList(region, "\\|");
String municipal = list.get(3);
return "0".equals(municipal) ? BaseIpConstants.UNKNOWN : municipal;
}
Expand All @@ -87,7 +87,7 @@ public static String getServiceProvider(String ip) {
if (StrUtil.isEmpty(region)) {
return BaseIpConstants.UNKNOWN;
}
List<String> list = StrUtil.strToStrList(region, "|");
List<String> list = StrUtil.strToStrList(region, "\\|");
String serviceProvider = list.get(4);
return "0".equals(serviceProvider) ? BaseIpConstants.UNKNOWN : serviceProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public String onRequest(OfflinePlayer player, String identifier) {
if (StrUtil.isEmpty(region)) {
return BaseIpConstants.UNKNOWN;
}
List<String> list = StrUtil.strToStrList(region, "|");
List<String> list = StrUtil.strToStrList(region, "\\|");
String national = list.get(0);
String provincial = list.get(2);
String municipal = list.get(3);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Ip2region
main: cn.handyplus.region.Ip2region
version: 1.1.3
version: 1.1.4
author: handy
api-version: 1.13
website: https://ricedoc.handyplus.cn/wiki/ip2region/log
Expand Down

0 comments on commit 178a204

Please sign in to comment.