-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(common): refactor event and utility classes for clarity and …
…consistency Refactor several core utility and event handling classes to improve code clarity and consistency. Update formatting in CQUtils, refine error handling in I18n, and simplify event formatting in IBotEvent. Also, introduce ActionPath enum and ActionHandler class for better management of action-related logic.
- Loading branch information
Showing
6 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
common/src/main/java/cn/evole/mods/mcbot/api/action/ActionPath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package cn.evole.mods.mcbot.api.action; | ||
|
||
/** | ||
* @Project: McBot | ||
* @Author: cnlimiter | ||
* @CreateTime: 2024/9/11 23:34 | ||
* @Description: 用于自定义服务器事件行为 | ||
*/ | ||
public enum ActionPath { | ||
PLAYER_ADVANCEMENT, | ||
PLAYER_CHANGE_DIMENSION, | ||
PLAYER_DEATH, | ||
PLAYER_LOGGED_IN, | ||
PLAYER_LOGGED_OUT, | ||
PLAYER_USE_CMD, | ||
PLAYER_CHAT, | ||
SERVER_TICK, | ||
SERVER_STOP, | ||
SERVER_START | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
common/src/main/java/cn/evole/mods/mcbot/plugins/action/ActionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cn.evole.mods.mcbot.plugins.action; | ||
|
||
import cn.evole.mods.mcbot.Constants; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* @Project: McBot | ||
* @Author: cnlimiter | ||
* @CreateTime: 2024/9/11 23:31 | ||
* @Description: | ||
*/ | ||
public class ActionHandler { | ||
private static final File dir = Constants.CONFIG_FOLDER.resolve("actions").toFile(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters