From 5734c97a5885d768be03b1e2b50310840ef7ee61 Mon Sep 17 00:00:00 2001 From: ZhangYuheng Date: Wed, 9 Oct 2024 14:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E7=B3=BB=E5=88=97bu?= =?UTF-8?q?g=EF=BC=9A=201.=20=E4=BF=AE=E5=A4=8D=E5=9C=A81.21=E4=B8=8B?= =?UTF-8?q?=E7=9A=84CUI=E6=8A=A5=E9=94=99=EF=BC=9B=202.=20=E7=8E=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=9C=A81.20.1=E4=BD=BF=E7=94=A8java17?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 --- README_zh.md | 3 --- api/build.gradle.kts | 2 +- build.gradle.kts | 6 +++--- core/build.gradle.kts | 2 +- core/src/main/java/cn/lunadeer/dominion/Commands.java | 1 + .../java/cn/lunadeer/dominion/dtos/DominionDTO.java | 8 ++++---- .../main/java/cn/lunadeer/dominion/dtos/GroupDTO.java | 10 +++++----- .../main/java/cn/lunadeer/dominion/dtos/MemberDTO.java | 6 +++--- .../main/java/cn/lunadeer/dominion/dtos/PlayerDTO.java | 8 ++++---- .../lunadeer/dominion/dtos/PrivilegeTemplateDTO.java | 6 +++--- .../cn/lunadeer/dominion/uis/cuis/CreateDominion.java | 2 +- docs/en-us/operator/README.md | 1 - docs/zh-cn/manage-dominion/sub-dominion.md | 2 +- docs/zh-cn/operator/README.md | 1 - docs/zh-hk/operator/README.md | 1 - v1_20_1/build.gradle.kts | 2 +- 17 files changed, 28 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 9d7d278c..28ad15b8 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,6 @@ For detail functions and features of Dominion, you can view [Introduction](intro - 1.20.1+ (Bukkit、Spigot、Paper、Folia) -> You need to use Java21 to run your server. If you are still using Java17, you can safely replace it with Java21. In -> theory, version 1.20.1+ can be directly upgraded to Java21. - > Although this plugin supports Spigot, we strongly recommend that you upgrade your core to Paper or its forked (such as > Purpur) for a better performance experience. diff --git a/README_zh.md b/README_zh.md index f01a3473..fbaf7e93 100644 --- a/README_zh.md +++ b/README_zh.md @@ -29,9 +29,6 @@ Dominion 是一个完全开源、免费,专为高版本开发,面向未来 - 1.20.1+ (Bukkit、Spigot、Paper、Folia) -> 需要使用 Java21 运行你的服务端,如果你还在使用 Java17 可以放心替换为 Java21,理论上 1.20.1+ 版本的服务端核心可以直接升级到 -> Java21 启动。 - > 虽然本插件支持 Spigot,但是我们强烈建议您将您的核心升级到 Paper 或其分支核心(如 Purpur)以获得更好的性能体验。 ## 帮助我们不断改进 diff --git a/api/build.gradle.kts b/api/build.gradle.kts index bd2115de..aa43245e 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(21)) + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) } // utf-8 diff --git a/build.gradle.kts b/build.gradle.kts index 8f37b57a..d8b40098 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,13 +8,13 @@ plugins { var BuildFull = properties["BuildFull"].toString() == "true" var libraries = listOf() -libraries = libraries + "cn.lunadeer:MinecraftPluginUtils:1.3.10" +libraries = libraries + "cn.lunadeer:MinecraftPluginUtils:2.0.2" group = "cn.lunadeer" -version = "2.13.4-beta" +version = "2.13.5-beta" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(21)) + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) } // utf-8 diff --git a/core/build.gradle.kts b/core/build.gradle.kts index b00e2f2d..6e61bb21 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(21)) + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) } // utf-8 diff --git a/core/src/main/java/cn/lunadeer/dominion/Commands.java b/core/src/main/java/cn/lunadeer/dominion/Commands.java index dbc79611..a8f58a3b 100644 --- a/core/src/main/java/cn/lunadeer/dominion/Commands.java +++ b/core/src/main/java/cn/lunadeer/dominion/Commands.java @@ -224,6 +224,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command "export_mca", "export_db", "import_db", + "version", "sys_config", "all_dominion", "set_map_color", diff --git a/core/src/main/java/cn/lunadeer/dominion/dtos/DominionDTO.java b/core/src/main/java/cn/lunadeer/dominion/dtos/DominionDTO.java index 5c32c438..4cccb01c 100644 --- a/core/src/main/java/cn/lunadeer/dominion/dtos/DominionDTO.java +++ b/core/src/main/java/cn/lunadeer/dominion/dtos/DominionDTO.java @@ -89,7 +89,7 @@ public static DominionDTO select(Integer id) { String sql = "SELECT * FROM dominion WHERE id = ? AND id > 0;"; List dominions = query(sql, id); if (dominions.isEmpty()) return null; - return dominions.getFirst(); + return dominions.get(0); } public static List selectByParentId(World world, Integer parentId) { @@ -113,7 +113,7 @@ public static DominionDTO select(String name) { String sql = "SELECT * FROM dominion WHERE name = ? AND id > 0;"; List dominions = query(sql, name); if (dominions.isEmpty()) return null; - return dominions.getFirst(); + return dominions.get(0); } public static DominionDTO insert(DominionDTO dominion) { @@ -133,7 +133,7 @@ public static DominionDTO insert(DominionDTO dominion) { Cache.instance.loadDominions(); List dominions = getDTOFromRS(rs); if (dominions.isEmpty()) return null; - return dominions.getFirst(); + return dominions.get(0); } catch (SQLException e) { DatabaseManager.handleDatabaseError("DominionDTO.insert ", e, insert.toString()); return null; @@ -237,7 +237,7 @@ private DominionDTO doUpdate(UpdateRow updateRow) { List dominions = getDTOFromRS(rs); if (dominions.isEmpty()) return null; Cache.instance.loadDominions((Integer) id.value); - return dominions.getFirst(); + return dominions.get(0); } catch (SQLException e) { DatabaseManager.handleDatabaseError("DominionDTO.doUpdate ", e, updateRow.toString()); return null; diff --git a/core/src/main/java/cn/lunadeer/dominion/dtos/GroupDTO.java b/core/src/main/java/cn/lunadeer/dominion/dtos/GroupDTO.java index 77ba0894..497513ff 100644 --- a/core/src/main/java/cn/lunadeer/dominion/dtos/GroupDTO.java +++ b/core/src/main/java/cn/lunadeer/dominion/dtos/GroupDTO.java @@ -107,8 +107,8 @@ public static GroupDTO create(String name, DominionDTO dominionDTO) { try (ResultSet rs = insertRow.execute()) { List groups = getDTOFromRS(rs); if (groups.isEmpty()) return null; - Cache.instance.loadGroups(groups.getFirst().getId()); - return groups.getFirst(); + Cache.instance.loadGroups(groups.get(0).getId()); + return groups.get(0); } catch (Exception e) { DatabaseManager.handleDatabaseError("GroupDTO.create ", e, ""); return null; @@ -133,14 +133,14 @@ public static GroupDTO select(Integer id) { String sql = "SELECT * FROM dominion_group WHERE id = ?;"; List groups = getDTOFromRS(DatabaseManager.instance.query(sql, id)); if (groups.isEmpty()) return null; - return groups.getFirst(); + return groups.get(0); } public static GroupDTO select(Integer domID, String name) { String sql = "SELECT * FROM dominion_group WHERE dom_id = ? AND name = ?;"; List groups = getDTOFromRS(DatabaseManager.instance.query(sql, domID, name)); if (groups.isEmpty()) return null; - return groups.getFirst(); + return groups.get(0); } public static List selectAll() { @@ -205,7 +205,7 @@ private GroupDTO doUpdate(UpdateRow updateRow) { List groups = getDTOFromRS(rs); if (groups.isEmpty()) return null; Cache.instance.loadGroups((Integer) id.value); - return groups.getFirst(); + return groups.get(0); } catch (Exception e) { DatabaseManager.handleDatabaseError("更新权限组失败: ", e, ""); return null; diff --git a/core/src/main/java/cn/lunadeer/dominion/dtos/MemberDTO.java b/core/src/main/java/cn/lunadeer/dominion/dtos/MemberDTO.java index a60add6a..74cf5c8e 100644 --- a/core/src/main/java/cn/lunadeer/dominion/dtos/MemberDTO.java +++ b/core/src/main/java/cn/lunadeer/dominion/dtos/MemberDTO.java @@ -56,7 +56,7 @@ private MemberDTO doUpdate(UpdateRow updateRow) { List players = getDTOFromRS(rs); if (players.isEmpty()) return null; Cache.instance.loadMembers(getPlayerUUID()); - return players.getFirst(); + return players.get(0); } catch (Exception e) { DatabaseManager.handleDatabaseError("MemberDTO.doUpdate ", e, ""); return null; @@ -76,7 +76,7 @@ public static MemberDTO insert(MemberDTO player) { Cache.instance.loadMembers(player.getPlayerUUID()); List players = getDTOFromRS(rs); if (players.isEmpty()) return null; - return players.getFirst(); + return players.get(0); } catch (Exception e) { DatabaseManager.handleDatabaseError("MemberDTO.insert ", e, ""); return null; @@ -87,7 +87,7 @@ public static MemberDTO select(UUID playerUUID, Integer dom_id) { String sql = "SELECT * FROM dominion_member WHERE player_uuid = ? AND dom_id = ?;"; List p = query(sql, playerUUID.toString(), dom_id); if (p.isEmpty()) return null; - return p.getFirst(); + return p.get(0); } public static List select(Integer dom_id) { diff --git a/core/src/main/java/cn/lunadeer/dominion/dtos/PlayerDTO.java b/core/src/main/java/cn/lunadeer/dominion/dtos/PlayerDTO.java index d1958994..7fe9e753 100644 --- a/core/src/main/java/cn/lunadeer/dominion/dtos/PlayerDTO.java +++ b/core/src/main/java/cn/lunadeer/dominion/dtos/PlayerDTO.java @@ -77,14 +77,14 @@ public static PlayerDTO select(UUID uuid) { String sql = "SELECT * FROM player_name WHERE uuid = ?;"; List players = query(sql, uuid.toString()); if (players.isEmpty()) return null; - return players.getFirst(); + return players.get(0); } public static PlayerDTO select(String name) { String sql = "SELECT * FROM player_name WHERE last_known_name = ?;"; List players = query(sql, name); if (players.isEmpty()) return null; - return players.getFirst(); + return players.get(0); } public static List search(String name) { @@ -114,7 +114,7 @@ private static PlayerDTO insert(PlayerDTO player) { try (ResultSet rs = insertRow.execute()) { List players = getDTOFromRS(rs); if (players.isEmpty()) return null; - return players.getFirst(); + return players.get(0); } catch (SQLException e) { DatabaseManager.handleDatabaseError("PlayerDTO.insert ", e, insertRow.toString()); return null; @@ -136,7 +136,7 @@ private static PlayerDTO update(PlayerDTO player) { try (ResultSet rs = updateRow.execute()) { List players = getDTOFromRS(rs); if (players.isEmpty()) return null; - return players.getFirst(); + return players.get(0); } catch (SQLException e) { DatabaseManager.handleDatabaseError("PlayerDTO.update ", e, updateRow.toString()); return null; diff --git a/core/src/main/java/cn/lunadeer/dominion/dtos/PrivilegeTemplateDTO.java b/core/src/main/java/cn/lunadeer/dominion/dtos/PrivilegeTemplateDTO.java index e6cd030d..c3144bab 100644 --- a/core/src/main/java/cn/lunadeer/dominion/dtos/PrivilegeTemplateDTO.java +++ b/core/src/main/java/cn/lunadeer/dominion/dtos/PrivilegeTemplateDTO.java @@ -55,7 +55,7 @@ public static PrivilegeTemplateDTO create(UUID creator, String name) { try (ResultSet rs = insertRow.execute()) { List templates = getDTOFromRS(rs); if (templates.isEmpty()) return null; - return templates.getFirst(); + return templates.get(0); } catch (Exception e) { DatabaseManager.handleDatabaseError("PrivilegeTemplateDTO.create ", e, null); return null; @@ -70,7 +70,7 @@ private PrivilegeTemplateDTO doUpdate(UpdateRow updateRow) { try (ResultSet rs = updateRow.execute()) { List templates = getDTOFromRS(rs); if (templates.isEmpty()) return null; - return templates.getFirst(); + return templates.get(0); } catch (Exception e) { DatabaseManager.handleDatabaseError("PrivilegeTemplateDTO.doUpdate ", e, null); return null; @@ -81,7 +81,7 @@ public static PrivilegeTemplateDTO select(UUID creator, String name) { String sql = "SELECT * FROM privilege_template WHERE creator = ? AND name = ?;"; List templates = query(sql, creator.toString(), name); if (templates.isEmpty()) return null; - return templates.getFirst(); + return templates.get(0); } public static List selectAll(UUID creator) { diff --git a/core/src/main/java/cn/lunadeer/dominion/uis/cuis/CreateDominion.java b/core/src/main/java/cn/lunadeer/dominion/uis/cuis/CreateDominion.java index 02a50ab8..72abb7d7 100644 --- a/core/src/main/java/cn/lunadeer/dominion/uis/cuis/CreateDominion.java +++ b/core/src/main/java/cn/lunadeer/dominion/uis/cuis/CreateDominion.java @@ -34,7 +34,7 @@ public void handleData(String input) { Map points = autoPoints(sender); operator.getResponse().thenAccept(result -> { if (Objects.equals(result.getStatus(), AbstractOperator.Result.SUCCESS)) { - DominionManage.show(sender, new String[]{"list"}); + DominionManage.show(sender, new String[]{input}); } }); DominionController.create(operator, input, points.get(0), points.get(1)); diff --git a/docs/en-us/operator/README.md b/docs/en-us/operator/README.md index 41c7f068..7f47ffd2 100644 --- a/docs/en-us/operator/README.md +++ b/docs/en-us/operator/README.md @@ -4,7 +4,6 @@ - 1.20.1 及以上; - Spigot、Paper、Folia...; -- Java 21 及以上; > 虽然本插件支持 Spigot 但是我们强烈推荐您升级到 Paper 或其分支核心(如 Purpur)以获得更好的性能体验。 diff --git a/docs/zh-cn/manage-dominion/sub-dominion.md b/docs/zh-cn/manage-dominion/sub-dominion.md index a6849951..0e93db1c 100644 --- a/docs/zh-cn/manage-dominion/sub-dominion.md +++ b/docs/zh-cn/manage-dominion/sub-dominion.md @@ -15,7 +15,7 @@ ## 权限 当玩家处在一个子领地内时,其行为只收到子领地的权限控制。 -子领地的权限设置与傅领地完全相同,参考[权限管理](permission/README.md)。 +子领地的权限设置与父领地完全相同,参考[权限管理](permission/README.md)。 ## 关于子领地嵌套 diff --git a/docs/zh-cn/operator/README.md b/docs/zh-cn/operator/README.md index 41c7f068..7f47ffd2 100644 --- a/docs/zh-cn/operator/README.md +++ b/docs/zh-cn/operator/README.md @@ -4,7 +4,6 @@ - 1.20.1 及以上; - Spigot、Paper、Folia...; -- Java 21 及以上; > 虽然本插件支持 Spigot 但是我们强烈推荐您升级到 Paper 或其分支核心(如 Purpur)以获得更好的性能体验。 diff --git a/docs/zh-hk/operator/README.md b/docs/zh-hk/operator/README.md index ffef6d99..d2556bdb 100644 --- a/docs/zh-hk/operator/README.md +++ b/docs/zh-hk/operator/README.md @@ -4,7 +4,6 @@ - 1.20.1 及以上; - Spigot、Paper、Folia...; -- Java 21 及以上; > 雖然本插件支持 Spigot 但是我們強烈推薦您升級到 Paper 或其分支核心(如 Purpur)以獲得更好的性能體驗。 diff --git a/v1_20_1/build.gradle.kts b/v1_20_1/build.gradle.kts index afb274ee..55cdadd2 100644 --- a/v1_20_1/build.gradle.kts +++ b/v1_20_1/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(21)) + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) } // utf-8