9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 18:09:17 +00:00

Refactor Improve Purpur AFK system

* Move Leaf config init before Minecraft commands register
* Fix broken afk command cooldown
* Cleanup code
This commit is contained in:
Dreeam
2025-03-17 20:54:15 -04:00
parent d3640fe0a4
commit 40fa45ef8d
4 changed files with 126 additions and 83 deletions

View File

@@ -0,0 +1,23 @@
package org.dreeam.leaf.config.modules.gameplay;
import org.dreeam.leaf.config.ConfigModules;
import org.dreeam.leaf.config.EnumConfigCategory;
public class AfkCommand extends ConfigModules {
public String getBasePath() {
return EnumConfigCategory.GAMEPLAY.getBaseKeyName() + ".afk-command";
}
public static boolean enabled = false;
@Override
public void onLoaded() {
enabled = config.getBoolean(getBasePath() + ".enabled", enabled, config.pickStringRegionBased("""
The AFK command based on Minecraft built-in idle-timeout mechanism
Rest of AFK settings are in the Purpur config""",
"""
基于原版 idle-timeout 系统的 AFK 指令
剩余配置项在 Purpur 配置里"""));
}
}