From f5fe937a23fcc890603947c4affa837e39173784 Mon Sep 17 00:00:00 2001 From: HowieHz Date: Thu, 4 Jul 2024 18:21:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=94=B9=E5=8C=85?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../hzzz => top/howiehz}/points/Points.java | 32 +++++++++---------- .../hzzz => top/howiehz}/points/README.md | 0 .../howiehz}/points/commands/Death.java | 16 +++++----- .../howiehz}/points/commands/Enderchest.java | 8 ++--- .../howiehz}/points/commands/FairPVP.java | 10 +++--- .../howiehz}/points/commands/Here.java | 12 +++---- .../points/commands/PointsCommand.java | 12 +++---- .../howiehz}/points/commands/Where.java | 10 +++--- .../base_executor/HowieUtilsExecutor.java | 4 +-- .../howiehz}/points/data_manager/README.md | 0 .../operations_utils/DeathLog.java | 10 +++--- .../operations_utils/DeathMessageConfig.java | 4 +-- .../data_manager/sqlite/BaseSQLite.java | 8 ++--- .../data_manager/sqlite/ConfigSQLite.java | 8 ++--- .../data_manager/sqlite/DeathLogSQLite.java | 8 ++--- .../points/listeners/AntiBoomListener.java | 15 ++++----- .../points/listeners/DeathListener.java | 20 ++++++------ .../base_listener/HowieUtilsListener.java | 4 +-- .../base_listener/NamedListener.java | 2 +- .../howiehz}/points/utils/Utils.java | 4 +-- .../base_utils_class/BaseUtilsClass.java | 10 +++--- .../utils/data_structure/AntiBoomInfo.java | 4 +-- .../utils/data_structure/CommandInfo.java | 4 +-- .../utils/data_structure/KeyAndMsgInfo.java | 4 +-- .../utils/data_structure/tuple/Tuple2.java | 2 +- .../utils/data_structure/tuple/Tuple3.java | 2 +- .../utils/data_structure/tuple/Tuple4.java | 2 +- .../github_update_checker/UpdateChecker.java | 4 +-- .../howiehz}/points/utils/message/Lang.java | 8 ++--- .../howiehz}/points/utils/message/MsgKey.java | 2 +- src/main/resources/plugin.yml | 2 +- 32 files changed, 116 insertions(+), 117 deletions(-) rename src/main/java/{com/hzzz => top/howiehz}/points/Points.java (92%) rename src/main/java/{com/hzzz => top/howiehz}/points/README.md (100%) rename src/main/java/{com/hzzz => top/howiehz}/points/commands/Death.java (94%) rename src/main/java/{com/hzzz => top/howiehz}/points/commands/Enderchest.java (93%) rename src/main/java/{com/hzzz => top/howiehz}/points/commands/FairPVP.java (95%) rename src/main/java/{com/hzzz => top/howiehz}/points/commands/Here.java (86%) rename src/main/java/{com/hzzz => top/howiehz}/points/commands/PointsCommand.java (90%) rename src/main/java/{com/hzzz => top/howiehz}/points/commands/Where.java (91%) rename src/main/java/{com/hzzz => top/howiehz}/points/commands/base_executor/HowieUtilsExecutor.java (59%) rename src/main/java/{com/hzzz => top/howiehz}/points/data_manager/README.md (100%) rename src/main/java/{com/hzzz => top/howiehz}/points/data_manager/operations_utils/DeathLog.java (97%) rename src/main/java/{com/hzzz => top/howiehz}/points/data_manager/operations_utils/DeathMessageConfig.java (95%) rename src/main/java/{com/hzzz => top/howiehz}/points/data_manager/sqlite/BaseSQLite.java (84%) rename src/main/java/{com/hzzz => top/howiehz}/points/data_manager/sqlite/ConfigSQLite.java (86%) rename src/main/java/{com/hzzz => top/howiehz}/points/data_manager/sqlite/DeathLogSQLite.java (89%) rename src/main/java/{com/hzzz => top/howiehz}/points/listeners/AntiBoomListener.java (90%) rename src/main/java/{com/hzzz => top/howiehz}/points/listeners/DeathListener.java (71%) rename src/main/java/{com/hzzz => top/howiehz}/points/listeners/base_listener/HowieUtilsListener.java (63%) rename src/main/java/{com/hzzz => top/howiehz}/points/listeners/base_listener/NamedListener.java (81%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/Utils.java (98%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/base_utils_class/BaseUtilsClass.java (97%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/data_structure/AntiBoomInfo.java (84%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/data_structure/CommandInfo.java (89%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/data_structure/KeyAndMsgInfo.java (81%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/data_structure/tuple/Tuple2.java (93%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/data_structure/tuple/Tuple3.java (94%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/data_structure/tuple/Tuple4.java (95%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/github_update_checker/UpdateChecker.java (97%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/message/Lang.java (97%) rename src/main/java/{com/hzzz => top/howiehz}/points/utils/message/MsgKey.java (97%) diff --git a/build.gradle b/build.gradle index e3f6d7d..a2cf478 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { } version = '0.2.6' -mainClassName = 'com.hzzz.points.Points' +mainClassName = 'top.howiehz.points.Points' repositories { // mavenLocal() 自己电脑的缓存 diff --git a/src/main/java/com/hzzz/points/Points.java b/src/main/java/top/howiehz/points/Points.java similarity index 92% rename from src/main/java/com/hzzz/points/Points.java rename to src/main/java/top/howiehz/points/Points.java index 3bd3478..c23b38d 100644 --- a/src/main/java/com/hzzz/points/Points.java +++ b/src/main/java/top/howiehz/points/Points.java @@ -1,15 +1,15 @@ -package com.hzzz.points; - -import com.hzzz.points.commands.*; -import com.hzzz.points.data_manager.sqlite.ConfigSQLite; -import com.hzzz.points.data_manager.sqlite.DeathLogSQLite; -import com.hzzz.points.listeners.AntiBoomListener; -import com.hzzz.points.listeners.DeathListener; -import com.hzzz.points.listeners.base_listener.NamedListener; -import com.hzzz.points.utils.base_utils_class.BaseUtilsClass; -import com.hzzz.points.utils.data_structure.CommandInfo; -import com.hzzz.points.utils.data_structure.tuple.Tuple4; -import com.hzzz.points.utils.github_update_checker.UpdateChecker; +package top.howiehz.points; + +import top.howiehz.points.commands.*; +import top.howiehz.points.data_manager.sqlite.ConfigSQLite; +import top.howiehz.points.data_manager.sqlite.DeathLogSQLite; +import top.howiehz.points.listeners.AntiBoomListener; +import top.howiehz.points.listeners.DeathListener; +import top.howiehz.points.listeners.base_listener.NamedListener; +import top.howiehz.points.utils.base_utils_class.BaseUtilsClass; +import top.howiehz.points.utils.data_structure.CommandInfo; +import top.howiehz.points.utils.data_structure.tuple.Tuple4; +import top.howiehz.points.utils.github_update_checker.UpdateChecker; import net.kyori.adventure.platform.bukkit.BukkitAudiences; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; @@ -24,10 +24,10 @@ import java.util.Objects; import java.util.logging.Logger; -import static com.hzzz.points.utils.Utils.*; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.Lang.reloadLangConfig; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.utils.Utils.*; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.Lang.reloadLangConfig; +import static top.howiehz.points.utils.message.MsgKey.*; /** *

插件主类

diff --git a/src/main/java/com/hzzz/points/README.md b/src/main/java/top/howiehz/points/README.md similarity index 100% rename from src/main/java/com/hzzz/points/README.md rename to src/main/java/top/howiehz/points/README.md diff --git a/src/main/java/com/hzzz/points/commands/Death.java b/src/main/java/top/howiehz/points/commands/Death.java similarity index 94% rename from src/main/java/com/hzzz/points/commands/Death.java rename to src/main/java/top/howiehz/points/commands/Death.java index db219ea..625912a 100644 --- a/src/main/java/com/hzzz/points/commands/Death.java +++ b/src/main/java/top/howiehz/points/commands/Death.java @@ -1,6 +1,6 @@ -package com.hzzz.points.commands; +package top.howiehz.points.commands; -import com.hzzz.points.commands.base_executor.HowieUtilsExecutor; +import top.howiehz.points.commands.base_executor.HowieUtilsExecutor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -9,12 +9,12 @@ import java.sql.SQLException; import java.util.*; -import static com.hzzz.points.data_manager.operations_utils.DeathLog.outputDeathLog; -import static com.hzzz.points.data_manager.operations_utils.DeathMessageConfig.updateDeathMessageConfig; -import static com.hzzz.points.utils.Utils.logError; -import static com.hzzz.points.utils.Utils.runTaskAsynchronously; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.data_manager.operations_utils.DeathLog.outputDeathLog; +import static top.howiehz.points.data_manager.operations_utils.DeathMessageConfig.updateDeathMessageConfig; +import static top.howiehz.points.utils.Utils.logError; +import static top.howiehz.points.utils.Utils.runTaskAsynchronously; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.*; /** * death指令的执行器以及tab补全 diff --git a/src/main/java/com/hzzz/points/commands/Enderchest.java b/src/main/java/top/howiehz/points/commands/Enderchest.java similarity index 93% rename from src/main/java/com/hzzz/points/commands/Enderchest.java rename to src/main/java/top/howiehz/points/commands/Enderchest.java index 5ac24d1..c1fe6be 100644 --- a/src/main/java/com/hzzz/points/commands/Enderchest.java +++ b/src/main/java/top/howiehz/points/commands/Enderchest.java @@ -1,6 +1,6 @@ -package com.hzzz.points.commands; +package top.howiehz.points.commands; -import com.hzzz.points.commands.base_executor.HowieUtilsExecutor; +import top.howiehz.points.commands.base_executor.HowieUtilsExecutor; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -10,8 +10,8 @@ import java.util.Collections; import java.util.List; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.*; /** *

随身潜影箱

diff --git a/src/main/java/com/hzzz/points/commands/FairPVP.java b/src/main/java/top/howiehz/points/commands/FairPVP.java similarity index 95% rename from src/main/java/com/hzzz/points/commands/FairPVP.java rename to src/main/java/top/howiehz/points/commands/FairPVP.java index 6bdde53..16899e9 100644 --- a/src/main/java/com/hzzz/points/commands/FairPVP.java +++ b/src/main/java/top/howiehz/points/commands/FairPVP.java @@ -1,6 +1,6 @@ -package com.hzzz.points.commands; +package top.howiehz.points.commands; -import com.hzzz.points.commands.base_executor.HowieUtilsExecutor; +import top.howiehz.points.commands.base_executor.HowieUtilsExecutor; import me.clip.placeholderapi.PlaceholderAPI; import org.bukkit.Bukkit; import org.bukkit.command.Command; @@ -12,9 +12,9 @@ import java.util.Collections; import java.util.List; -import static com.hzzz.points.utils.Utils.executeCommand; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.utils.Utils.executeCommand; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.*; /** *

fair pvp

diff --git a/src/main/java/com/hzzz/points/commands/Here.java b/src/main/java/top/howiehz/points/commands/Here.java similarity index 86% rename from src/main/java/com/hzzz/points/commands/Here.java rename to src/main/java/top/howiehz/points/commands/Here.java index 9c561c6..09c9ac0 100644 --- a/src/main/java/com/hzzz/points/commands/Here.java +++ b/src/main/java/top/howiehz/points/commands/Here.java @@ -1,6 +1,6 @@ -package com.hzzz.points.commands; +package top.howiehz.points.commands; -import com.hzzz.points.commands.base_executor.HowieUtilsExecutor; +import top.howiehz.points.commands.base_executor.HowieUtilsExecutor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -14,10 +14,10 @@ import java.util.Collections; import java.util.List; -import static com.hzzz.points.utils.Utils.sendComponentMessageToPlayers; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.NO_PERMISSION; -import static com.hzzz.points.utils.message.MsgKey.PLAYER_ONLY; +import static top.howiehz.points.utils.Utils.sendComponentMessageToPlayers; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.NO_PERMISSION; +import static top.howiehz.points.utils.message.MsgKey.PLAYER_ONLY; /** * here指令的执行器以及tab补全 diff --git a/src/main/java/com/hzzz/points/commands/PointsCommand.java b/src/main/java/top/howiehz/points/commands/PointsCommand.java similarity index 90% rename from src/main/java/com/hzzz/points/commands/PointsCommand.java rename to src/main/java/top/howiehz/points/commands/PointsCommand.java index f5f9090..02a7891 100644 --- a/src/main/java/com/hzzz/points/commands/PointsCommand.java +++ b/src/main/java/top/howiehz/points/commands/PointsCommand.java @@ -1,7 +1,7 @@ -package com.hzzz.points.commands; +package top.howiehz.points.commands; -import com.hzzz.points.Points; -import com.hzzz.points.commands.base_executor.HowieUtilsExecutor; +import top.howiehz.points.Points; +import top.howiehz.points.commands.base_executor.HowieUtilsExecutor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -10,9 +10,9 @@ import java.util.ArrayList; import java.util.List; -import static com.hzzz.points.utils.Utils.logInfo; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.utils.Utils.logInfo; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.*; /** * points指令的执行器以及tab补全 diff --git a/src/main/java/com/hzzz/points/commands/Where.java b/src/main/java/top/howiehz/points/commands/Where.java similarity index 91% rename from src/main/java/com/hzzz/points/commands/Where.java rename to src/main/java/top/howiehz/points/commands/Where.java index f0f4a9f..c645a14 100644 --- a/src/main/java/com/hzzz/points/commands/Where.java +++ b/src/main/java/top/howiehz/points/commands/Where.java @@ -1,6 +1,6 @@ -package com.hzzz.points.commands; +package top.howiehz.points.commands; -import com.hzzz.points.commands.base_executor.HowieUtilsExecutor; +import top.howiehz.points.commands.base_executor.HowieUtilsExecutor; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -10,9 +10,9 @@ import java.util.Collections; import java.util.List; -import static com.hzzz.points.utils.Utils.sendComponentMessage; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.utils.Utils.sendComponentMessage; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.*; /** * where指令的执行器以及tab补全 diff --git a/src/main/java/com/hzzz/points/commands/base_executor/HowieUtilsExecutor.java b/src/main/java/top/howiehz/points/commands/base_executor/HowieUtilsExecutor.java similarity index 59% rename from src/main/java/com/hzzz/points/commands/base_executor/HowieUtilsExecutor.java rename to src/main/java/top/howiehz/points/commands/base_executor/HowieUtilsExecutor.java index cf7817c..ec453bb 100644 --- a/src/main/java/com/hzzz/points/commands/base_executor/HowieUtilsExecutor.java +++ b/src/main/java/top/howiehz/points/commands/base_executor/HowieUtilsExecutor.java @@ -1,6 +1,6 @@ -package com.hzzz.points.commands.base_executor; +package top.howiehz.points.commands.base_executor; -import com.hzzz.points.utils.base_utils_class.BaseUtilsClass; +import top.howiehz.points.utils.base_utils_class.BaseUtilsClass; import org.bukkit.command.TabExecutor; /** diff --git a/src/main/java/com/hzzz/points/data_manager/README.md b/src/main/java/top/howiehz/points/data_manager/README.md similarity index 100% rename from src/main/java/com/hzzz/points/data_manager/README.md rename to src/main/java/top/howiehz/points/data_manager/README.md diff --git a/src/main/java/com/hzzz/points/data_manager/operations_utils/DeathLog.java b/src/main/java/top/howiehz/points/data_manager/operations_utils/DeathLog.java similarity index 97% rename from src/main/java/com/hzzz/points/data_manager/operations_utils/DeathLog.java rename to src/main/java/top/howiehz/points/data_manager/operations_utils/DeathLog.java index 38b7926..370bace 100644 --- a/src/main/java/com/hzzz/points/data_manager/operations_utils/DeathLog.java +++ b/src/main/java/top/howiehz/points/data_manager/operations_utils/DeathLog.java @@ -1,6 +1,6 @@ -package com.hzzz.points.data_manager.operations_utils; +package top.howiehz.points.data_manager.operations_utils; -import com.hzzz.points.data_manager.sqlite.DeathLogSQLite; +import top.howiehz.points.data_manager.sqlite.DeathLogSQLite; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.HoverEvent; @@ -17,9 +17,9 @@ import java.text.SimpleDateFormat; import java.util.UUID; -import static com.hzzz.points.utils.Utils.*; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.utils.Utils.*; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.*; /** * 有关DeathLog的数据库操作 diff --git a/src/main/java/com/hzzz/points/data_manager/operations_utils/DeathMessageConfig.java b/src/main/java/top/howiehz/points/data_manager/operations_utils/DeathMessageConfig.java similarity index 95% rename from src/main/java/com/hzzz/points/data_manager/operations_utils/DeathMessageConfig.java rename to src/main/java/top/howiehz/points/data_manager/operations_utils/DeathMessageConfig.java index 4029bf6..80e11a1 100644 --- a/src/main/java/com/hzzz/points/data_manager/operations_utils/DeathMessageConfig.java +++ b/src/main/java/top/howiehz/points/data_manager/operations_utils/DeathMessageConfig.java @@ -1,6 +1,6 @@ -package com.hzzz.points.data_manager.operations_utils; +package top.howiehz.points.data_manager.operations_utils; -import com.hzzz.points.data_manager.sqlite.ConfigSQLite; +import top.howiehz.points.data_manager.sqlite.ConfigSQLite; import org.bukkit.entity.Player; import java.sql.PreparedStatement; diff --git a/src/main/java/com/hzzz/points/data_manager/sqlite/BaseSQLite.java b/src/main/java/top/howiehz/points/data_manager/sqlite/BaseSQLite.java similarity index 84% rename from src/main/java/com/hzzz/points/data_manager/sqlite/BaseSQLite.java rename to src/main/java/top/howiehz/points/data_manager/sqlite/BaseSQLite.java index 67a9f02..6420444 100644 --- a/src/main/java/com/hzzz/points/data_manager/sqlite/BaseSQLite.java +++ b/src/main/java/top/howiehz/points/data_manager/sqlite/BaseSQLite.java @@ -1,13 +1,13 @@ -package com.hzzz.points.data_manager.sqlite; +package top.howiehz.points.data_manager.sqlite; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.Utils.logError; -import static com.hzzz.points.utils.message.MsgKey.DATABASE_DRIVER_ERROR; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.Utils.logError; +import static top.howiehz.points.utils.message.MsgKey.DATABASE_DRIVER_ERROR; /** *

sqlite数据库对象 基类

diff --git a/src/main/java/com/hzzz/points/data_manager/sqlite/ConfigSQLite.java b/src/main/java/top/howiehz/points/data_manager/sqlite/ConfigSQLite.java similarity index 86% rename from src/main/java/com/hzzz/points/data_manager/sqlite/ConfigSQLite.java rename to src/main/java/top/howiehz/points/data_manager/sqlite/ConfigSQLite.java index 77fc3de..7887fa4 100644 --- a/src/main/java/com/hzzz/points/data_manager/sqlite/ConfigSQLite.java +++ b/src/main/java/top/howiehz/points/data_manager/sqlite/ConfigSQLite.java @@ -1,11 +1,11 @@ -package com.hzzz.points.data_manager.sqlite; +package top.howiehz.points.data_manager.sqlite; import java.sql.PreparedStatement; import java.sql.SQLException; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.Utils.logError; -import static com.hzzz.points.utils.message.MsgKey.DATABASE_SETUP_ERROR; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.Utils.logError; +import static top.howiehz.points.utils.message.MsgKey.DATABASE_SETUP_ERROR; /** * 管理config.sqlite diff --git a/src/main/java/com/hzzz/points/data_manager/sqlite/DeathLogSQLite.java b/src/main/java/top/howiehz/points/data_manager/sqlite/DeathLogSQLite.java similarity index 89% rename from src/main/java/com/hzzz/points/data_manager/sqlite/DeathLogSQLite.java rename to src/main/java/top/howiehz/points/data_manager/sqlite/DeathLogSQLite.java index 73dee1b..6dd2cf0 100644 --- a/src/main/java/com/hzzz/points/data_manager/sqlite/DeathLogSQLite.java +++ b/src/main/java/top/howiehz/points/data_manager/sqlite/DeathLogSQLite.java @@ -1,11 +1,11 @@ -package com.hzzz.points.data_manager.sqlite; +package top.howiehz.points.data_manager.sqlite; import java.sql.PreparedStatement; import java.sql.SQLException; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.Utils.logError; -import static com.hzzz.points.utils.message.MsgKey.DATABASE_SETUP_ERROR; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.Utils.logError; +import static top.howiehz.points.utils.message.MsgKey.DATABASE_SETUP_ERROR; /** * 管理death_log.sqlite diff --git a/src/main/java/com/hzzz/points/listeners/AntiBoomListener.java b/src/main/java/top/howiehz/points/listeners/AntiBoomListener.java similarity index 90% rename from src/main/java/com/hzzz/points/listeners/AntiBoomListener.java rename to src/main/java/top/howiehz/points/listeners/AntiBoomListener.java index 3d27b89..7278bb4 100644 --- a/src/main/java/com/hzzz/points/listeners/AntiBoomListener.java +++ b/src/main/java/top/howiehz/points/listeners/AntiBoomListener.java @@ -1,8 +1,8 @@ -package com.hzzz.points.listeners; +package top.howiehz.points.listeners; import com.google.common.collect.ImmutableList; -import com.hzzz.points.listeners.base_listener.HowieUtilsListener; -import com.hzzz.points.utils.data_structure.AntiBoomInfo; +import top.howiehz.points.listeners.base_listener.HowieUtilsListener; +import top.howiehz.points.utils.data_structure.AntiBoomInfo; import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -13,12 +13,11 @@ import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.jetbrains.annotations.NotNull; +import top.howiehz.points.utils.message.MsgKey; import java.util.Objects; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.ENTER_BED_CANCELED; -import static com.hzzz.points.utils.message.MsgKey.USE_RESPAWN_ANCHOR_CANCELED; +import static top.howiehz.points.utils.message.Lang.getMessage; import static org.bukkit.Material.*; /** @@ -153,11 +152,11 @@ public void onBadOrRespawnAnchor(@NotNull PlayerInteractEvent e) { if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) { // 是不是右手 if (Objects.requireNonNull(e.getClickedBlock()).getType().equals(RESPAWN_ANCHOR)) { // 是不是重生锚 if (checkWorldConfig(e, "anti-boom.respawn-anchor", worldName)) { - player.sendMessage(getMessage(USE_RESPAWN_ANCHOR_CANCELED)); + player.sendMessage(getMessage(MsgKey.USE_RESPAWN_ANCHOR_CANCELED)); } } else if (bedsList.contains(e.getClickedBlock().getType())) { // 是不是床 if (checkWorldConfig(e, "anti-boom.bed", worldName)) { - player.sendMessage(getMessage(ENTER_BED_CANCELED)); + player.sendMessage(getMessage(MsgKey.ENTER_BED_CANCELED)); } } } diff --git a/src/main/java/com/hzzz/points/listeners/DeathListener.java b/src/main/java/top/howiehz/points/listeners/DeathListener.java similarity index 71% rename from src/main/java/com/hzzz/points/listeners/DeathListener.java rename to src/main/java/top/howiehz/points/listeners/DeathListener.java index 54b5717..145c4f7 100644 --- a/src/main/java/com/hzzz/points/listeners/DeathListener.java +++ b/src/main/java/top/howiehz/points/listeners/DeathListener.java @@ -1,18 +1,18 @@ -package com.hzzz.points.listeners; +package top.howiehz.points.listeners; -import com.hzzz.points.listeners.base_listener.HowieUtilsListener; +import top.howiehz.points.listeners.base_listener.HowieUtilsListener; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.PlayerDeathEvent; import org.jetbrains.annotations.NotNull; +import top.howiehz.points.data_manager.operations_utils.DeathLog; +import top.howiehz.points.data_manager.operations_utils.DeathMessageConfig; +import top.howiehz.points.utils.Utils; import java.sql.SQLException; -import static com.hzzz.points.data_manager.operations_utils.DeathLog.insertDeathLog; -import static com.hzzz.points.data_manager.operations_utils.DeathMessageConfig.isEnableDeathMessage; -import static com.hzzz.points.utils.Utils.runTaskAsynchronously; -import static com.hzzz.points.utils.Utils.sendComponentMessage; +import static top.howiehz.points.utils.Utils.sendComponentMessage; /** * 玩家死亡事件监听器 @@ -59,12 +59,12 @@ public void onPlayerDeath(@NotNull PlayerDeathEvent e) { if (!checkPermissionOneConfigNode(player, "death.message.listener", "points.listener.death.message")) { return; } - runTaskAsynchronously(() -> { + Utils.runTaskAsynchronously(() -> { // isEnableDeathMessage insertDeathLog需要异步 try { - if (config.getBoolean("death.message.enable", false) && isEnableDeathMessage(player)) { // 出现错误默认不发送死亡消息 + if (config.getBoolean("death.message.enable", false) && DeathMessageConfig.isEnableDeathMessage(player)) { // 出现错误默认不发送死亡消息 // 生成并发送消息给执行者 - sendComponentMessage(player,buildPlayerCoordinatesMessage("death.message", player, " X-> ", NamedTextColor.RED)); + Utils.sendComponentMessage(player,buildPlayerCoordinatesMessage("death.message", player, " X-> ", NamedTextColor.RED)); } } catch (SQLException ex) { ex.printStackTrace(); @@ -76,7 +76,7 @@ public void onPlayerDeath(@NotNull PlayerDeathEvent e) { if (deathMessage == null) { // 被手动设置deathMessage才可能为null吧 return; } - insertDeathLog(player, deathMessage, config.getInt("death.log.record-limit", 5)); + DeathLog.insertDeathLog(player, deathMessage, config.getInt("death.log.record-limit", 5)); } }); } diff --git a/src/main/java/com/hzzz/points/listeners/base_listener/HowieUtilsListener.java b/src/main/java/top/howiehz/points/listeners/base_listener/HowieUtilsListener.java similarity index 63% rename from src/main/java/com/hzzz/points/listeners/base_listener/HowieUtilsListener.java rename to src/main/java/top/howiehz/points/listeners/base_listener/HowieUtilsListener.java index 332f300..c9c86e0 100644 --- a/src/main/java/com/hzzz/points/listeners/base_listener/HowieUtilsListener.java +++ b/src/main/java/top/howiehz/points/listeners/base_listener/HowieUtilsListener.java @@ -1,6 +1,6 @@ -package com.hzzz.points.listeners.base_listener; +package top.howiehz.points.listeners.base_listener; -import com.hzzz.points.utils.base_utils_class.BaseUtilsClass; +import top.howiehz.points.utils.base_utils_class.BaseUtilsClass; /** *

diff --git a/src/main/java/com/hzzz/points/listeners/base_listener/NamedListener.java b/src/main/java/top/howiehz/points/listeners/base_listener/NamedListener.java similarity index 81% rename from src/main/java/com/hzzz/points/listeners/base_listener/NamedListener.java rename to src/main/java/top/howiehz/points/listeners/base_listener/NamedListener.java index 9caebb1..9ba2789 100644 --- a/src/main/java/com/hzzz/points/listeners/base_listener/NamedListener.java +++ b/src/main/java/top/howiehz/points/listeners/base_listener/NamedListener.java @@ -1,4 +1,4 @@ -package com.hzzz.points.listeners.base_listener; +package top.howiehz.points.listeners.base_listener; import org.bukkit.event.Listener; diff --git a/src/main/java/com/hzzz/points/utils/Utils.java b/src/main/java/top/howiehz/points/utils/Utils.java similarity index 98% rename from src/main/java/com/hzzz/points/utils/Utils.java rename to src/main/java/top/howiehz/points/utils/Utils.java index b02f280..5ca6b44 100644 --- a/src/main/java/com/hzzz/points/utils/Utils.java +++ b/src/main/java/top/howiehz/points/utils/Utils.java @@ -1,6 +1,6 @@ -package com.hzzz.points.utils; +package top.howiehz.points.utils; -import com.hzzz.points.Points; +import top.howiehz.points.Points; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/hzzz/points/utils/base_utils_class/BaseUtilsClass.java b/src/main/java/top/howiehz/points/utils/base_utils_class/BaseUtilsClass.java similarity index 97% rename from src/main/java/com/hzzz/points/utils/base_utils_class/BaseUtilsClass.java rename to src/main/java/top/howiehz/points/utils/base_utils_class/BaseUtilsClass.java index 0b9d208..2b4fabb 100644 --- a/src/main/java/com/hzzz/points/utils/base_utils_class/BaseUtilsClass.java +++ b/src/main/java/top/howiehz/points/utils/base_utils_class/BaseUtilsClass.java @@ -1,6 +1,6 @@ -package com.hzzz.points.utils.base_utils_class; +package top.howiehz.points.utils.base_utils_class; -import com.hzzz.points.Points; +import top.howiehz.points.Points; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.HoverEvent; @@ -10,9 +10,9 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; -import static com.hzzz.points.utils.Utils.checkPermission; -import static com.hzzz.points.utils.message.Lang.getMessage; -import static com.hzzz.points.utils.message.MsgKey.*; +import static top.howiehz.points.utils.Utils.checkPermission; +import static top.howiehz.points.utils.message.Lang.getMessage; +import static top.howiehz.points.utils.message.MsgKey.*; /** *

权限检查的封装 消息生成的封装

diff --git a/src/main/java/com/hzzz/points/utils/data_structure/AntiBoomInfo.java b/src/main/java/top/howiehz/points/utils/data_structure/AntiBoomInfo.java similarity index 84% rename from src/main/java/com/hzzz/points/utils/data_structure/AntiBoomInfo.java rename to src/main/java/top/howiehz/points/utils/data_structure/AntiBoomInfo.java index 58de60d..b302e7a 100644 --- a/src/main/java/com/hzzz/points/utils/data_structure/AntiBoomInfo.java +++ b/src/main/java/top/howiehz/points/utils/data_structure/AntiBoomInfo.java @@ -1,6 +1,6 @@ -package com.hzzz.points.utils.data_structure; +package top.howiehz.points.utils.data_structure; -import com.hzzz.points.utils.data_structure.tuple.Tuple2; +import top.howiehz.points.utils.data_structure.tuple.Tuple2; import org.bukkit.entity.EntityType; /** diff --git a/src/main/java/com/hzzz/points/utils/data_structure/CommandInfo.java b/src/main/java/top/howiehz/points/utils/data_structure/CommandInfo.java similarity index 89% rename from src/main/java/com/hzzz/points/utils/data_structure/CommandInfo.java rename to src/main/java/top/howiehz/points/utils/data_structure/CommandInfo.java index bef489e..9af9531 100644 --- a/src/main/java/com/hzzz/points/utils/data_structure/CommandInfo.java +++ b/src/main/java/top/howiehz/points/utils/data_structure/CommandInfo.java @@ -1,6 +1,6 @@ -package com.hzzz.points.utils.data_structure; +package top.howiehz.points.utils.data_structure; -import com.hzzz.points.utils.data_structure.tuple.Tuple4; +import top.howiehz.points.utils.data_structure.tuple.Tuple4; import org.bukkit.command.TabExecutor; import java.util.function.Supplier; diff --git a/src/main/java/com/hzzz/points/utils/data_structure/KeyAndMsgInfo.java b/src/main/java/top/howiehz/points/utils/data_structure/KeyAndMsgInfo.java similarity index 81% rename from src/main/java/com/hzzz/points/utils/data_structure/KeyAndMsgInfo.java rename to src/main/java/top/howiehz/points/utils/data_structure/KeyAndMsgInfo.java index df5b13f..8db1670 100644 --- a/src/main/java/com/hzzz/points/utils/data_structure/KeyAndMsgInfo.java +++ b/src/main/java/top/howiehz/points/utils/data_structure/KeyAndMsgInfo.java @@ -1,6 +1,6 @@ -package com.hzzz.points.utils.data_structure; +package top.howiehz.points.utils.data_structure; -import com.hzzz.points.utils.message.MsgKey; +import top.howiehz.points.utils.message.MsgKey; /** *

用于初始化文字

diff --git a/src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple2.java b/src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple2.java similarity index 93% rename from src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple2.java rename to src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple2.java index f4b12ad..85d7616 100644 --- a/src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple2.java +++ b/src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple2.java @@ -1,4 +1,4 @@ -package com.hzzz.points.utils.data_structure.tuple; +package top.howiehz.points.utils.data_structure.tuple; /** *

tuple2,从vavr中精简了一下

diff --git a/src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple3.java b/src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple3.java similarity index 94% rename from src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple3.java rename to src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple3.java index 4f8ca71..00ee668 100644 --- a/src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple3.java +++ b/src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple3.java @@ -1,4 +1,4 @@ -package com.hzzz.points.utils.data_structure.tuple; +package top.howiehz.points.utils.data_structure.tuple; /** *

tuple3,从vavr中精简了一下

diff --git a/src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple4.java b/src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple4.java similarity index 95% rename from src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple4.java rename to src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple4.java index 2d7bb36..34d0efc 100644 --- a/src/main/java/com/hzzz/points/utils/data_structure/tuple/Tuple4.java +++ b/src/main/java/top/howiehz/points/utils/data_structure/tuple/Tuple4.java @@ -1,4 +1,4 @@ -package com.hzzz.points.utils.data_structure.tuple; +package top.howiehz.points.utils.data_structure.tuple; /** *

tuple4,从vavr中精简了一下

diff --git a/src/main/java/com/hzzz/points/utils/github_update_checker/UpdateChecker.java b/src/main/java/top/howiehz/points/utils/github_update_checker/UpdateChecker.java similarity index 97% rename from src/main/java/com/hzzz/points/utils/github_update_checker/UpdateChecker.java rename to src/main/java/top/howiehz/points/utils/github_update_checker/UpdateChecker.java index cc22349..3e39234 100644 --- a/src/main/java/com/hzzz/points/utils/github_update_checker/UpdateChecker.java +++ b/src/main/java/top/howiehz/points/utils/github_update_checker/UpdateChecker.java @@ -1,8 +1,8 @@ -package com.hzzz.points.utils.github_update_checker; +package top.howiehz.points.utils.github_update_checker; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import com.hzzz.points.utils.data_structure.tuple.Tuple4; +import top.howiehz.points.utils.data_structure.tuple.Tuple4; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/com/hzzz/points/utils/message/Lang.java b/src/main/java/top/howiehz/points/utils/message/Lang.java similarity index 97% rename from src/main/java/com/hzzz/points/utils/message/Lang.java rename to src/main/java/top/howiehz/points/utils/message/Lang.java index 10c2dd6..b472355 100644 --- a/src/main/java/com/hzzz/points/utils/message/Lang.java +++ b/src/main/java/top/howiehz/points/utils/message/Lang.java @@ -1,7 +1,7 @@ -package com.hzzz.points.utils.message; +package top.howiehz.points.utils.message; -import com.hzzz.points.Points; -import com.hzzz.points.utils.data_structure.KeyAndMsgInfo; +import top.howiehz.points.Points; +import top.howiehz.points.utils.data_structure.KeyAndMsgInfo; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; @@ -9,7 +9,7 @@ import java.io.File; import java.util.EnumMap; -import static com.hzzz.points.utils.Utils.logError; +import static top.howiehz.points.utils.Utils.logError; /** * 文字管理

diff --git a/src/main/java/com/hzzz/points/utils/message/MsgKey.java b/src/main/java/top/howiehz/points/utils/message/MsgKey.java similarity index 97% rename from src/main/java/com/hzzz/points/utils/message/MsgKey.java rename to src/main/java/top/howiehz/points/utils/message/MsgKey.java index 0d34f4d..99e7516 100644 --- a/src/main/java/com/hzzz/points/utils/message/MsgKey.java +++ b/src/main/java/top/howiehz/points/utils/message/MsgKey.java @@ -1,4 +1,4 @@ -package com.hzzz.points.utils.message; +package top.howiehz.points.utils.message; /** * 枚举文字键 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c1bece6..5f59595 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -8,7 +8,7 @@ description: Some useful points website: https://github.com/HowieHz/Points # Technical settings -main: com.hzzz.points.Points +main: top.howiehz.points.Points api-version: 1.16 softdepend: [PlaceholderAPI, AureliumSkills]