diff --git a/patches/server/0003-Leaf-Config.patch b/patches/server/0003-Leaf-Config.patch index 634df508d..ca6657c7e 100644 --- a/patches/server/0003-Leaf-Config.patch +++ b/patches/server/0003-Leaf-Config.patch @@ -423,10 +423,10 @@ index 0000000000000000000000000000000000000000..fdbdf3f6a5071ce629d2881e861075db +} diff --git a/src/main/java/org/dreeam/leaf/config/LeafGlobalConfig.java b/src/main/java/org/dreeam/leaf/config/LeafGlobalConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..db7bdee965c988777dab3db38f09511c72fed921 +index 0000000000000000000000000000000000000000..794bc822d987ee2bb69b953ea70ae3ee08124ac5 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/LeafGlobalConfig.java -@@ -0,0 +1,111 @@ +@@ -0,0 +1,137 @@ +package org.dreeam.leaf.config; + +import io.github.thatsmusic99.configurationmaster.api.ConfigFile; @@ -434,20 +434,26 @@ index 0000000000000000000000000000000000000000..db7bdee965c988777dab3db38f09511c + +import java.io.File; +import java.util.List; ++import java.util.Locale; +import java.util.Map; + +public class LeafGlobalConfig { + + protected static ConfigFile configFile; ++ private static final String CURRENT_REGION = Locale.getDefault().getCountry().toUpperCase(Locale.ROOT); // It will be in uppercase by default, just make sure ++ protected static final boolean isCN = CURRENT_REGION.equals("CN"); + + public LeafGlobalConfig(boolean init) throws Exception { + configFile = ConfigFile.loadConfig(new File(LeafConfig.I_CONFIG_FOLDER, LeafConfig.I_GLOBAL_CONFIG_FILE)); + configFile.set("config-version", 3.0); -+ configFile.addComments("config-version", """ ++ configFile.addComments("config-version", pickStringRegionBased(""" + Leaf Config -+ Github Repo: https://github.com/Winds-Studio/Leaf -+ Discord: https://discord.com/invite/gfgAwdSEuM -+ QQ Group: 619278377"""); ++ GitHub Repo: https://github.com/Winds-Studio/Leaf ++ Discord: https://discord.com/invite/gfgAwdSEuM""", ++ """ ++ Leaf Config ++ GitHub Repo: https://github.com/Winds-Studio/Leaf ++ QQ Group: 619278377""")); + + // Pre-structure to force order + structureConfig(); @@ -537,4 +543,24 @@ index 0000000000000000000000000000000000000000..db7bdee965c988777dab3db38f09511c + public void addComment(String path, String comment) { + configFile.addComment(path, comment); + } ++ ++ public void addCommentIfCN(String path, String comment) { ++ if (isCN) { ++ configFile.addComment(path, comment); ++ } ++ } ++ ++ public void addCommentIfNonCN(String path, String comment) { ++ if (!isCN) { ++ configFile.addComment(path, comment); ++ } ++ } ++ ++ public void addCommentRegionBased(String path, String en, String cn) { ++ configFile.addComment(path, isCN ? cn : en); ++ } ++ ++ public String pickStringRegionBased(String en, String cn) { ++ return isCN ? cn : en; ++ } +} diff --git a/patches/server/0006-Pufferfish-Sentry.patch b/patches/server/0006-Pufferfish-Sentry.patch index bde0a42ab..0810e721f 100644 --- a/patches/server/0006-Pufferfish-Sentry.patch +++ b/patches/server/0006-Pufferfish-Sentry.patch @@ -217,10 +217,10 @@ index fdbdf3f6a5071ce629d2881e861075dbeef11b42..41b24849b6601cdf89ee6cb4125a7127 diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/SentryDSN.java b/src/main/java/org/dreeam/leaf/config/modules/misc/SentryDSN.java new file mode 100644 -index 0000000000000000000000000000000000000000..b37aa469c0e1d1b18c1f43a364e00276ce8652e0 +index 0000000000000000000000000000000000000000..0234fc0d3054d8348da49a8006ec99d6d09114fe --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/SentryDSN.java -@@ -0,0 +1,37 @@ +@@ -0,0 +1,43 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.apache.logging.log4j.Level; @@ -241,17 +241,23 @@ index 0000000000000000000000000000000000000000..b37aa469c0e1d1b18c1f43a364e00276 + @Override + public void onLoaded() { + String sentryEnvironment = System.getenv("SENTRY_DSN"); -+ String sentryConfig = config.getString(sentryDsnConfigPath = getBasePath() + ".dsn", sentryDsn, """ ++ String sentryConfig = config.getString(sentryDsnConfigPath = getBasePath() + ".dsn", sentryDsn, config.pickStringRegionBased(""" + Sentry DSN for improved error logging, leave blank to disable, -+ Obtain from https://sentry.io/"""); ++ Obtain from https://sentry.io/""", ++ """ ++ Sentry DSN (出现严重错误时将发送至配置的Sentry DSN地址) (留空关闭)""")); + + sentryDsn = sentryEnvironment == null + ? sentryConfig + : sentryEnvironment; -+ logLevel = config.getString(getBasePath() + ".log-level", logLevel, """ -+ Logs with a level higher than or equal to this level will be recorded"""); -+ onlyLogThrown = config.getBoolean(getBasePath() + ".only-log-thrown", onlyLogThrown, """ -+ Only log with a Throwable will be recorded after enabling this"""); ++ logLevel = config.getString(getBasePath() + ".log-level", logLevel, config.pickStringRegionBased(""" ++ Logs with a level higher than or equal to this level will be recorded.""", ++ """ ++ 大于等于该等级的日志会被记录.""")); ++ onlyLogThrown = config.getBoolean(getBasePath() + ".only-log-thrown", onlyLogThrown, config.pickStringRegionBased(""" ++ Only log with a Throwable will be recorded after enabling this.""", ++ """ ++ 是否仅记录带有 Throwable 的日志.""")); + + if (sentryDsn != null && !sentryDsn.isBlank()) { + gg.pufferfish.pufferfish.sentry.SentryManager.init(Level.getLevel(logLevel)); diff --git a/patches/server/0007-Pufferfish-Optimize-mob-spawning.patch b/patches/server/0007-Pufferfish-Optimize-mob-spawning.patch index 050827099..550a71cc8 100644 --- a/patches/server/0007-Pufferfish-Optimize-mob-spawning.patch +++ b/patches/server/0007-Pufferfish-Optimize-mob-spawning.patch @@ -155,10 +155,10 @@ index d8b4196adf955f8d414688dc451caac2d9c609d9..80a43def4912a3228cd95117d5c2aac6 // Paper - rewrite chunk system diff --git a/src/main/java/org/dreeam/leaf/config/modules/async/AsyncMobSpawning.java b/src/main/java/org/dreeam/leaf/config/modules/async/AsyncMobSpawning.java new file mode 100644 -index 0000000000000000000000000000000000000000..8a3726a747ff4640f9936a9eae1dca34e5203029 +index 0000000000000000000000000000000000000000..9a9cbb8ab1281fa1e8e98ed2d6fec4f68cfd002a --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/async/AsyncMobSpawning.java -@@ -0,0 +1,30 @@ +@@ -0,0 +1,34 @@ +package org.dreeam.leaf.config.modules.async; + +import org.dreeam.leaf.config.ConfigModules; @@ -175,12 +175,16 @@ index 0000000000000000000000000000000000000000..8a3726a747ff4640f9936a9eae1dca34 + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + Whether or not asynchronous mob spawning should be enabled. + On servers with many entities, this can improve performance by up to 15%. You must have + paper's per-player-mob-spawns setting set to true for this to work. + One quick note - this does not actually spawn mobs async (that would be very unsafe). -+ This just offloads some expensive calculations that are required for mob spawning."""); ++ This just offloads some expensive calculations that are required for mob spawning.""", ++ """ ++ 是否异步化生物生成. ++ 在实体较多的服务器上, 异步生成可最高带来15%的性能提升. ++ 须在Paper配置文件中打开 per-player-mob-spawns 才能生效."""); + + // This prevents us from changing the value during a reload. + if (!asyncMobSpawningInitialized) { diff --git a/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch b/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch index ae132e7e6..69c0d0bf8 100644 --- a/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch +++ b/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch @@ -295,10 +295,10 @@ index 491a4c38cbb393c1a565d75a87c0444e321938c0..e1fd6ad56c0fbaf59c9d9ac985ab5301 } diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/DynamicActivationofBrain.java b/src/main/java/org/dreeam/leaf/config/modules/opt/DynamicActivationofBrain.java new file mode 100644 -index 0000000000000000000000000000000000000000..a2e60c43074df560eb01f150bf52b8d0f5af9b54 +index 0000000000000000000000000000000000000000..7e1e06ff65d1e186e6ec41917945d3d90fe72008 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/DynamicActivationofBrain.java -@@ -0,0 +1,71 @@ +@@ -0,0 +1,81 @@ +package org.dreeam.leaf.config.modules.opt; + +import net.minecraft.core.registries.BuiltInRegistries; @@ -327,27 +327,37 @@ index 0000000000000000000000000000000000000000..a2e60c43074df560eb01f150bf52b8d0 + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + Optimizes entity brains when -+ they're far away from the player"""); ++ they're far away from the player""", ++ """ ++ 根据距离动态优化生物 AI"""); + + enabled = config.getBoolean(getBasePath() + ".enabled", enabled); -+ dontEnableIfInWater = config.getBoolean(getBasePath() + ".dont-enable-if-in-water", dontEnableIfInWater, """ ++ dontEnableIfInWater = config.getBoolean(getBasePath() + ".dont-enable-if-in-water", dontEnableIfInWater, config.pickStringRegionBased(""" + After enabling this, non-aquatic entities in the water will not be affected by DAB. -+ This could fix entities suffocate in the water."""); -+ startDistance = config.getInt(getBasePath() + ".start-distance", startDistance, """ ++ This could fix entities suffocate in the water.""", ++ """ ++ 启用此项后, 在水中的非水生生物将不会被 DAB 影响. ++ 可以避免距离玩家较远的生物在水里淹死.""")); ++ startDistance = config.getInt(getBasePath() + ".start-distance", startDistance, config.pickStringRegionBased(""" + This value determines how far away an entity has to be -+ from the player to start being effected by DEAR."""); -+ maximumActivationPrio = config.getInt(getBasePath() + ".max-tick-freq", maximumActivationPrio, """ ++ from the player to start being effected by DEAR.""", ++ """ ++ 生物距离玩家多少格 DAB 开始生效""")); ++ maximumActivationPrio = config.getInt(getBasePath() + ".max-tick-freq", maximumActivationPrio, config.pickStringRegionBased(""" + This value defines how often in ticks, the furthest entity -+ will get their pathfinders and behaviors ticked. 20 = 1s"""); ++ will get their pathfinders and behaviors ticked. 20 = 1s""", ++ """ ++ 最远处的实体每隔多少刻tick一次""")); + activationDistanceMod = config.getInt(getBasePath() + ".activation-dist-mod", activationDistanceMod, """ + This value defines how much distance modifies an entity's + tick frequency. freq = (distanceToPlayer^2) / (2^value)", + If you want further away entities to tick less often, use 7. + If you want further away entities to tick more often, try 9."""); + blackedEntities = config.getList(getBasePath() + ".blacklisted-entities", blackedEntities, -+ "A list of entities to ignore for activation"); ++ config.pickStringRegionBased("A list of entities to ignore for activation", ++ "不会被 DAB 影响的实体列表")); + + startDistanceSquared = startDistance * startDistance; + diff --git a/patches/server/0009-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch b/patches/server/0009-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch index cdcb61994..cd88afda4 100644 --- a/patches/server/0009-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch +++ b/patches/server/0009-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch @@ -7,7 +7,7 @@ Original license: GPL v3 Original project: https://github.com/pufferfish-gg/Pufferfish diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 96e7e9ef8bf9ab6902638ac4ba270a1f98a36cdf..6d88b2888d2028cb88e34dce3d7963dd818b58d7 100644 +index df932757d6a2f6812a1be16a3a71c4c4c75768b5..aa6d06c5b873ae92d7de6c091a8b9d27221ef7f8 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -233,11 +233,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @@ -27,10 +27,10 @@ index 96e7e9ef8bf9ab6902638ac4ba270a1f98a36cdf..6d88b2888d2028cb88e34dce3d7963dd if (this.targetSelector.inactiveTick(this.activatedPriority, true)) { // Pufferfish - pass activated priority diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/ThrottleInactiveGoalSelectorTick.java b/src/main/java/org/dreeam/leaf/config/modules/opt/ThrottleInactiveGoalSelectorTick.java new file mode 100644 -index 0000000000000000000000000000000000000000..3e2b97faa4fddcd0dfbfedc8e7515f89b7cdb3bb +index 0000000000000000000000000000000000000000..785215c05111424bbcd2d9708ed05b35530bb9c5 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/ThrottleInactiveGoalSelectorTick.java -@@ -0,0 +1,20 @@ +@@ -0,0 +1,23 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -46,8 +46,11 @@ index 0000000000000000000000000000000000000000..3e2b97faa4fddcd0dfbfedc8e7515f89 + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath() + ".inactive-goal-selector-throttle", enabled, """ ++ enabled = config.getBoolean(getBasePath() + ".inactive-goal-selector-throttle", enabled, config.pickStringRegionBased(""" + Throttles the AI goal selector in entity inactive ticks. -+ This can improve performance by a few percent, but has minor gameplay implications."""); ++ This can improve performance by a few percent, but has minor gameplay implications.""", ++ """ ++ 是否在实体不活跃 tick 时阻塞 AI 目标选择器. ++ 有助于提升性能, 但对游戏有轻微影响.""")); + } +} diff --git a/patches/server/0010-Pufferfish-Entity-TTL.patch b/patches/server/0010-Pufferfish-Entity-TTL.patch index 78659f125..ff10ba4a7 100644 --- a/patches/server/0010-Pufferfish-Entity-TTL.patch +++ b/patches/server/0010-Pufferfish-Entity-TTL.patch @@ -7,7 +7,7 @@ Original license: GPL v3 Original project: https://github.com/pufferfish-gg/Pufferfish diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index be9815bdf5652a7856fd72d3fca3e2562b2fb8c6..815db5b0a24f1628d646893ebad466dcee2ab0bd 100644 +index 22d3d963dc9806643608d077324b27832641ce57..60fbed7a31fbeca07eae8ea6b0fb97705961bb7e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -849,6 +849,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -37,10 +37,10 @@ index b2d8a858d8767bd6ca52e0b8db84757986c6ed61..f9440014ab2fe753c16b9383f5fffbb8 @Nullable diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/EntityTTL.java b/src/main/java/org/dreeam/leaf/config/modules/opt/EntityTTL.java new file mode 100644 -index 0000000000000000000000000000000000000000..656655343653b1854a93fb074c4fa04bda98754d +index 0000000000000000000000000000000000000000..dbab6168992fb9bb50f7cbc49a0cc7aa7e357666 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/EntityTTL.java -@@ -0,0 +1,36 @@ +@@ -0,0 +1,39 @@ +package org.dreeam.leaf.config.modules.opt; + +import net.minecraft.core.registries.BuiltInRegistries; @@ -58,11 +58,14 @@ index 0000000000000000000000000000000000000000..656655343653b1854a93fb074c4fa04b + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + These values define a entity's maximum lifespan. If an + entity is in this list and it has survived for longer than + that number of ticks, then it will be removed. Setting a value to -+ -1 disables this feature."""); ++ -1 disables this feature.""", ++ """ ++ 这些值定义了实体的最大生命周期. ++ 如果实体存活时间超过指定的 tick 将被移除, 设置为 -1 可禁用此功能."""); + + // Set some defaults + config.getInt(getBasePath() + ".SNOWBALL", -1); diff --git a/patches/server/0017-Remove-vanilla-username-check.patch b/patches/server/0017-Remove-vanilla-username-check.patch index 518e688bd..080cc1b2f 100644 --- a/patches/server/0017-Remove-vanilla-username-check.patch +++ b/patches/server/0017-Remove-vanilla-username-check.patch @@ -46,10 +46,10 @@ index f58dec12326734c61f4bc2298a87fb38f1ac1dc4..66eff9ddee09f44935df6d8ed3eb2494 } diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveVanillaUsernameCheck.java b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveVanillaUsernameCheck.java new file mode 100644 -index 0000000000000000000000000000000000000000..ecae8c5d114b2d0510b61c78e3fc705b61f6d126 +index 0000000000000000000000000000000000000000..f094806fdc4f98924aab69b5dffb3a3ffbc2e21d --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveVanillaUsernameCheck.java -@@ -0,0 +1,20 @@ +@@ -0,0 +1,23 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -65,8 +65,11 @@ index 0000000000000000000000000000000000000000..ecae8c5d114b2d0510b61c78e3fc705b + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath(), enabled, """ -+ Remove Vanilla username check -+ allowing all characters as username"""); ++ enabled = config.getBoolean(getBasePath(), enabled, config.pickStringRegionBased(""" ++ Remove Vanilla username check, ++ allowing all characters as username.""", ++ """ ++ 移除原版的用户名验证, ++ 让所有字符均可作为玩家名.""")); + } +} diff --git a/patches/server/0018-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch b/patches/server/0018-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch index 7c7e7183b..56d594509 100644 --- a/patches/server/0018-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch +++ b/patches/server/0018-Remove-Spigot-Check-for-Broken-BungeeCord-Configurat.patch @@ -19,10 +19,10 @@ index a1e39d4476e932da3d4e0c363ce22eb5be2b8e6c..e4911a420c81a371142f556584cc05a4 this.connection.disconnect(chatmessage); diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveSpigotCheckBungee.java b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveSpigotCheckBungee.java new file mode 100644 -index 0000000000000000000000000000000000000000..18672fc1415fdc4d8021e5dcd5aa19739500f7fa +index 0000000000000000000000000000000000000000..f7dad48d09759db5254dc7dbcef64f801a0a1546 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveSpigotCheckBungee.java -@@ -0,0 +1,20 @@ +@@ -0,0 +1,22 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -38,8 +38,10 @@ index 0000000000000000000000000000000000000000..18672fc1415fdc4d8021e5dcd5aa1973 + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath(), enabled, """ ++ enabled = config.getBoolean(getBasePath(), enabled, config.pickStringRegionBased(""" + Enable player enter backend server through proxy -+ without backend server enabling its bungee mode"""); ++ without backend server enabling its bungee mode.""", ++ """ ++ 使服务器无需打开 bungee 模式即可让玩家加入后端服务器.""")); + } +} diff --git a/patches/server/0019-Remove-UseItemOnPacket-Too-Far-Check.patch b/patches/server/0019-Remove-UseItemOnPacket-Too-Far-Check.patch index eb78d029c..8705b3842 100644 --- a/patches/server/0019-Remove-UseItemOnPacket-Too-Far-Check.patch +++ b/patches/server/0019-Remove-UseItemOnPacket-Too-Far-Check.patch @@ -25,10 +25,10 @@ index adf4732e57927810d34bf37fb3e9d2dc7b7977d5..def145674389e1e942a69ae4bdf11b5a this.player.resetLastActionTime(); diff --git a/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableMaxUseItemDistance.java b/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableMaxUseItemDistance.java new file mode 100644 -index 0000000000000000000000000000000000000000..aef8135fe44330a2459f06ebc10816f1ed83ac7e +index 0000000000000000000000000000000000000000..b1ae10cec5638f65320327ba6bfe112fd25cae8c --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableMaxUseItemDistance.java -@@ -0,0 +1,23 @@ +@@ -0,0 +1,28 @@ +package org.dreeam.leaf.config.modules.gameplay; + +import org.dreeam.leaf.config.ConfigModules; @@ -44,11 +44,16 @@ index 0000000000000000000000000000000000000000..aef8135fe44330a2459f06ebc10816f1 + + @Override + public void onLoaded() { -+ maxUseItemDistance = config.getDouble(getBasePath() + ".max-use-item-distance", maxUseItemDistance, """ ++ maxUseItemDistance = config.getDouble(getBasePath() + ".max-use-item-distance", maxUseItemDistance, config.pickStringRegionBased(""" + The max distance of UseItem for players. + Set to -1 to disable max-distance-check. + NOTE: if set to -1 to disable the check, + players are able to use some packet modules of hack clients, -+ and NoCom Exploit!!"""); ++ and NoCom Exploit!!""", ++ """ ++ 玩家 UseItem 的最大距离. ++ 设置为 -1 来禁用最大距离检测. ++ 注意: 禁用此项后, ++ 玩家可以使用作弊客户端的部分发包模块和 NoCom 漏洞!!""")); + } +} diff --git a/patches/server/0038-Leaves-Disable-moved-wrongly-threshold.patch b/patches/server/0038-Leaves-Disable-moved-wrongly-threshold.patch index e5dd002c5..da4ce00da 100644 --- a/patches/server/0038-Leaves-Disable-moved-wrongly-threshold.patch +++ b/patches/server/0038-Leaves-Disable-moved-wrongly-threshold.patch @@ -48,10 +48,10 @@ index 0abef2fd45d384583272a183bae42df5cbacfcec..39428db6c83527c085f4dcb012b4da29 toX, toY, toZ, toYaw, toPitch, true); diff --git a/src/main/java/org/dreeam/leaf/config/modules/gameplay/DisableMovedWronglyThreshold.java b/src/main/java/org/dreeam/leaf/config/modules/gameplay/DisableMovedWronglyThreshold.java new file mode 100644 -index 0000000000000000000000000000000000000000..6643345144c8a11cedb2de0fac512013f7f4d705 +index 0000000000000000000000000000000000000000..14ed289c91a99d6fd7d12462a7bde506e2ecbedc --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/gameplay/DisableMovedWronglyThreshold.java -@@ -0,0 +1,19 @@ +@@ -0,0 +1,22 @@ +package org.dreeam.leaf.config.modules.gameplay; + +import org.dreeam.leaf.config.ConfigModules; @@ -68,6 +68,9 @@ index 0000000000000000000000000000000000000000..6643345144c8a11cedb2de0fac512013 + @Override + public void onLoaded() { + enabled = config.getBoolean(getBasePath() + ".disable-moved-wrongly-threshold", enabled, -+ "Disable moved quickly/wrongly checks"); ++ config.pickStringRegionBased( ++ "Disable moved quickly/wrongly checks.", ++ "关闭 moved wrongly/too quickly! 警告." ++ )); + } +} diff --git a/patches/server/0042-Optimize-Minecart-collisions.patch b/patches/server/0042-Optimize-Minecart-collisions.patch index e6fb3144c..6a9bc4c43 100644 --- a/patches/server/0042-Optimize-Minecart-collisions.patch +++ b/patches/server/0042-Optimize-Minecart-collisions.patch @@ -9,7 +9,7 @@ Skip tick collisions to to prevent lag causing by massive stacked Minecart Useful for anarchy server. diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java -index f1b9e83206cc67e6ef29ebe088351b0aaa5eb349..e0a51e269aa076def275710174d3654d07e1a7aa 100644 +index 4830ebddade00f62287bcc9d7b17be83c0ad3a56..fca917561944017e032ea39ffb22cbd2c89b9f51 100644 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java @@ -63,6 +63,13 @@ public final class EntitySelector { @@ -27,7 +27,7 @@ index f1b9e83206cc67e6ef29ebe088351b0aaa5eb349..e0a51e269aa076def275710174d3654d Team.CollisionRule scoreboardteambase_enumteampush = scoreboardteam == null ? Team.CollisionRule.ALWAYS : scoreboardteam.getCollisionRule(); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -index 337bd2011c471361653c317004f8380c9fddfc47..52c105f5634ec8495e2e4c05adcc8217eb352e63 100644 +index 8b1c00062a5272d1020bc85491d8627c4d5f46cb..ec437f625f10098c008571569abb89ad4af52781 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java @@ -386,15 +386,15 @@ public abstract class AbstractMinecart extends VehicleEntity { @@ -76,10 +76,10 @@ index 337bd2011c471361653c317004f8380c9fddfc47..52c105f5634ec8495e2e4c05adcc8217 if (this.isInLava()) { diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizeMinecart.java b/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizeMinecart.java new file mode 100644 -index 0000000000000000000000000000000000000000..4e7b953f1b9db2a20c88d75ba9df3fa62be70658 +index 0000000000000000000000000000000000000000..8ca03c5abfb9e11dfbb6e65453052780e289c686 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizeMinecart.java -@@ -0,0 +1,24 @@ +@@ -0,0 +1,26 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -96,11 +96,13 @@ index 0000000000000000000000000000000000000000..4e7b953f1b9db2a20c88d75ba9df3fa6 + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath() + ".enabled", enabled, """ ++ enabled = config.getBoolean(getBasePath() + ".enabled", enabled, config.pickStringRegionBased(""" + Enable this feature to handle a large amount of stacked minecarts better. + By skipping tick collisions to reduce expensive getEntities + and bukkit event calls, useful for anarchy servers. -+ """); ++ """, ++ """ ++ 开启此项可更好地承受大量堆叠矿车. (通过跳过碰撞 tick 的方式)""")); + skipTickCount = config.getInt(getBasePath() + ".skip-tick-count", skipTickCount); + } +} diff --git a/patches/server/0047-Faster-sequencing-of-futures-for-chunk-structure-gen.patch b/patches/server/0047-Faster-sequencing-of-futures-for-chunk-structure-gen.patch index 82da2b6dc..7e2c74fb2 100644 --- a/patches/server/0047-Faster-sequencing-of-futures-for-chunk-structure-gen.patch +++ b/patches/server/0047-Faster-sequencing-of-futures-for-chunk-structure-gen.patch @@ -66,10 +66,10 @@ index a6b6e5ea191c0e2cd7a2e4f01b89d8af40a83c1b..713fced29fbd819ee6f151c7f3e462f5 ChunkGeneratorStructureState.LOGGER.debug("Calculation for {} took {}s", structureSetEntry, d2); diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/FasterStructureGenFutureSequencing.java b/src/main/java/org/dreeam/leaf/config/modules/opt/FasterStructureGenFutureSequencing.java new file mode 100644 -index 0000000000000000000000000000000000000000..44e1e25cc0de1d9de6ba9b66ec7502cd91f92c7b +index 0000000000000000000000000000000000000000..97a730047491c4ada75963185bb8b2e6f56c56a2 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/FasterStructureGenFutureSequencing.java -@@ -0,0 +1,19 @@ +@@ -0,0 +1,21 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -86,6 +86,8 @@ index 0000000000000000000000000000000000000000..44e1e25cc0de1d9de6ba9b66ec7502cd + @Override + public void onLoaded() { + enabled = config.getBoolean(getBasePath() + ".faster-structure-gen-future-sequencing", enabled, -+ "May cause the inconsistent order of future compose tasks."); ++ config.pickStringRegionBased( ++ "May cause the inconsistent order of future compose tasks.", ++ "更快的结构生成任务分段.")); + } +} diff --git a/patches/server/0049-Linear-region-file-format.patch b/patches/server/0049-Linear-region-file-format.patch index b6340031d..2e5ae895a 100644 --- a/patches/server/0049-Linear-region-file-format.patch +++ b/patches/server/0049-Linear-region-file-format.patch @@ -332,10 +332,10 @@ index 54f7aa95cfbcf39bb86ad1b4eb0f9ff2f8526030..7c4b81e97562bb158478c70dae082526 } catch (final IOException ex) { diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/RegionFormatConfig.java b/src/main/java/org/dreeam/leaf/config/modules/misc/RegionFormatConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..528eadb302bbb0de583edf69752162254d202f15 +index 0000000000000000000000000000000000000000..7f95e17544b762ad4674315e53fcff8e80105cb8 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/RegionFormatConfig.java -@@ -0,0 +1,55 @@ +@@ -0,0 +1,62 @@ +package org.dreeam.leaf.config.modules.misc; + +import com.mojang.logging.LogUtils; @@ -363,17 +363,24 @@ index 0000000000000000000000000000000000000000..528eadb302bbb0de583edf6975216225 + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + Linear is a region file format that uses ZSTD compression instead of + ZLIB. + This format saves about 50% of disk space. + Read Documentation before using: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools + Disclaimer: This is an experimental feature, there is potential risk to lose chunk data. -+ So backup your server before switching to Linear. -+ """); ++ So backup your server before switching to Linear.""", ++ """ ++ Linear 是一种使用 ZSTD 压缩而非 ZLIB 的区域文件格式. ++ 该格式可节省约 50% 的磁盘空间. ++ 使用前请阅读文档: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools ++ 免责声明: 实验性功能,有可能导致区块数据丢失. ++ 切换到Linear前请备份服务器."""); + + regionFormatTypeName = config.getString(getBasePath() + ".region-format", regionFormatTypeName, -+ "Available region formats: MCA, LINEAR"); ++ config.pickStringRegionBased( ++ "Available region formats: MCA, LINEAR", ++ "可用格式: MCA, LINEAR")); + linearCompressionLevel = config.getInt(getBasePath() + ".linear-compress-level", linearCompressionLevel); + throwOnUnknownExtension = config().getBoolean(getBasePath() + ".throw-on-unknown-extension-detected", throwOnUnknownExtension); + linearFlushFrequency = config.getInt(getBasePath() + ".flush-interval-seconds", linearFlushFrequency); diff --git a/patches/server/0058-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch b/patches/server/0058-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch index d802d82d6..267962b7b 100644 --- a/patches/server/0058-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch +++ b/patches/server/0058-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch @@ -24,10 +24,10 @@ index 67425f4270c0745fc962c6ffb90e98bb4362d261..989e0f049805a734d6aa18434dd2a3b2 // Paper start - Perf: Optimize Hoppers diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/ThrottleHopperWhenFull.java b/src/main/java/org/dreeam/leaf/config/modules/opt/ThrottleHopperWhenFull.java new file mode 100644 -index 0000000000000000000000000000000000000000..97257fb1db8e54a35b9badb8cf0a2be2e0646e51 +index 0000000000000000000000000000000000000000..3facc08ed627a710a1cf26c67abfbfa1b380fe44 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/ThrottleHopperWhenFull.java -@@ -0,0 +1,22 @@ +@@ -0,0 +1,26 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -44,9 +44,13 @@ index 0000000000000000000000000000000000000000..97257fb1db8e54a35b9badb8cf0a2be2 + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath() + ".enabled", enabled, """ -+ Throttles the hopper if target container is full."""); -+ skipTicks = config.getInt(getBasePath() + ".skip-ticks", skipTicks, """ -+ How many ticks to throttle when the Hopper is throttled."""); ++ enabled = config.getBoolean(getBasePath() + ".enabled", enabled, config.pickStringRegionBased(""" ++ Throttles the hopper if target container is full.""", ++ """ ++ 是否在目标容器已满时阻塞漏斗.""")); ++ skipTicks = config.getInt(getBasePath() + ".skip-ticks", skipTicks, config.pickStringRegionBased(""" ++ How many ticks to throttle when the Hopper is throttled.""", ++ """ ++ 每次阻塞多少 tick.""")); + } +} diff --git a/patches/server/0059-Polpot-Make-egg-and-snowball-can-knockback-player.patch b/patches/server/0059-Polpot-Make-egg-and-snowball-can-knockback-player.patch index 6d353fada..11a50226b 100644 --- a/patches/server/0059-Polpot-Make-egg-and-snowball-can-knockback-player.patch +++ b/patches/server/0059-Polpot-Make-egg-and-snowball-can-knockback-player.patch @@ -43,10 +43,10 @@ index dbd60cc8c39f5d2d4c77e2de4f2567e7fa456cd2..94baa609e49db229b03592c3fddb388b @Override diff --git a/src/main/java/org/dreeam/leaf/config/modules/gameplay/Knockback.java b/src/main/java/org/dreeam/leaf/config/modules/gameplay/Knockback.java new file mode 100644 -index 0000000000000000000000000000000000000000..35e8a9568cd37f4ed75d10a38beea996c8729388 +index 0000000000000000000000000000000000000000..7b434158818834450ea43611e2ab5636917bb938 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/gameplay/Knockback.java -@@ -0,0 +1,22 @@ +@@ -0,0 +1,28 @@ +package org.dreeam.leaf.config.modules.gameplay; + +import org.dreeam.leaf.config.ConfigModules; @@ -64,8 +64,14 @@ index 0000000000000000000000000000000000000000..35e8a9568cd37f4ed75d10a38beea996 + @Override + public void onLoaded() { + snowballCanKnockback = config.getBoolean(getBasePath() + ".snowball-knockback-players", snowballCanKnockback, -+ "Make snowball can knockback players"); ++ config.pickStringRegionBased( ++ "Make snowball can knockback players.", ++ "使雪球可以击退玩家." ++ )); + eggCanKnockback = config.getBoolean(getBasePath() + ".egg-knockback-players", eggCanKnockback, -+ "Make egg can knockback players"); ++ config.pickStringRegionBased( ++ "Make egg can knockback players.", ++ "使鸡蛋可以击退玩家." ++ )); + } +} diff --git a/patches/server/0076-Virtual-Thread-for-async-scheduler.patch b/patches/server/0076-Virtual-Thread-for-async-scheduler.patch index a2abd1ef6..ca6a8211f 100644 --- a/patches/server/0076-Virtual-Thread-for-async-scheduler.patch +++ b/patches/server/0076-Virtual-Thread-for-async-scheduler.patch @@ -56,10 +56,10 @@ index 3c1992e212a6d6f1db4d5b807b38d71913619fc0..4975fde71785a86dc812829f640ec274 @Override diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/VT4BukkitScheduler.java b/src/main/java/org/dreeam/leaf/config/modules/opt/VT4BukkitScheduler.java new file mode 100644 -index 0000000000000000000000000000000000000000..98883caa95c8734c15965049ce1bef729fffcf35 +index 0000000000000000000000000000000000000000..df1acd2fbf3edf84005e63b88475f739dc7518f4 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/VT4BukkitScheduler.java -@@ -0,0 +1,19 @@ +@@ -0,0 +1,21 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -76,6 +76,8 @@ index 0000000000000000000000000000000000000000..98883caa95c8734c15965049ce1bef72 + @Override + public void onLoaded() { + enabled = config.getBoolean(getBasePath() + ".use-virtual-thread-for-async-scheduler", enabled, -+ "Use the new Virtual Thread introduced in JDK 21 for CraftAsyncScheduler."); ++ config.pickStringRegionBased( ++ "Use the new Virtual Thread introduced in JDK 21 for CraftAsyncScheduler.", ++ "是否为异步任务调度器使用虚拟线程.")); + } +} diff --git a/patches/server/0077-Virtual-thread-for-chat-executor.patch b/patches/server/0077-Virtual-thread-for-chat-executor.patch index bb8dbcee8..d6e61b286 100644 --- a/patches/server/0077-Virtual-thread-for-chat-executor.patch +++ b/patches/server/0077-Virtual-thread-for-chat-executor.patch @@ -19,10 +19,10 @@ index a6d6e3ad434420223178f813953d9c53db26034a..2445d549fbf972620f2cc13860f82656 public ChatDecorator getChatDecorator() { diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/VT4ChatExecutor.java b/src/main/java/org/dreeam/leaf/config/modules/opt/VT4ChatExecutor.java new file mode 100644 -index 0000000000000000000000000000000000000000..a00f559076f5efbaf72217c4a889f246fc5f60d4 +index 0000000000000000000000000000000000000000..964c20331661774b4d8866f9eef50e60dbf3069b --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/VT4ChatExecutor.java -@@ -0,0 +1,19 @@ +@@ -0,0 +1,21 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -39,6 +39,8 @@ index 0000000000000000000000000000000000000000..a00f559076f5efbaf72217c4a889f246 + @Override + public void onLoaded() { + enabled = config.getBoolean(getBasePath() + ".use-virtual-thread-for-async-chat-executor", enabled, -+ "Use the new Virtual Thread introduced in JDK 21 for Async Chat Executor."); ++ config.pickStringRegionBased( ++ "Use the new Virtual Thread introduced in JDK 21 for Async Chat Executor.", ++ "是否为异步聊天线程使用虚拟线程.")); + } +} diff --git a/patches/server/0078-Mirai-Configurable-chat-message-signatures.patch b/patches/server/0078-Mirai-Configurable-chat-message-signatures.patch index 87801b90e..17ea53c5e 100644 --- a/patches/server/0078-Mirai-Configurable-chat-message-signatures.patch +++ b/patches/server/0078-Mirai-Configurable-chat-message-signatures.patch @@ -173,10 +173,10 @@ index 3ac1446ed791e06e2bbf226b925890ac4d1a16de..2cdfd22baf31df99e2c2b1d114c47cb8 diff --git a/src/main/java/org/dreeam/leaf/config/modules/network/ChatMessageSignature.java b/src/main/java/org/dreeam/leaf/config/modules/network/ChatMessageSignature.java new file mode 100644 -index 0000000000000000000000000000000000000000..b3050d65ec5cc86e497e698e4a70f03ae27f175b +index 0000000000000000000000000000000000000000..096969e2c3089e6b4f7332c06bf8a45a7dbe610b --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/network/ChatMessageSignature.java -@@ -0,0 +1,23 @@ +@@ -0,0 +1,25 @@ +package org.dreeam.leaf.config.modules.network; + +import org.dreeam.leaf.config.ConfigModules; @@ -192,11 +192,13 @@ index 0000000000000000000000000000000000000000..b3050d65ec5cc86e497e698e4a70f03a + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath() + ".chat-message-signature", enabled, """ ++ enabled = config.getBoolean(getBasePath() + ".chat-message-signature", enabled, config.pickStringRegionBased(""" + Whether or not enable chat message signature, + disable will prevent players to report chat messages. + And also disables the popup when joining a server without + 'secure chat', such as offline-mode servers. -+ """); ++ """, ++ """ ++ 是否启用聊天签名, 禁用后玩家无法进行聊天举报.""")); + } +} diff --git a/patches/server/0079-Cache-player-profileResult.patch b/patches/server/0079-Cache-player-profileResult.patch index 42dceda6e..357fee31e 100644 --- a/patches/server/0079-Cache-player-profileResult.patch +++ b/patches/server/0079-Cache-player-profileResult.patch @@ -58,10 +58,10 @@ index 885c6b8c82d46f8e21eb648441dba10c3f3a99f6..7b494af5736c2036d4810f304eb238b5 GameProfile gameprofile = profileresult.profile(); diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/Cache.java b/src/main/java/org/dreeam/leaf/config/modules/misc/Cache.java new file mode 100644 -index 0000000000000000000000000000000000000000..b0a5bfbebb3ad1598ba4164a8f2635862d3e424c +index 0000000000000000000000000000000000000000..ca342af5e5b305fe9f8ecb88d06af63426f11f87 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/Cache.java -@@ -0,0 +1,24 @@ +@@ -0,0 +1,29 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -78,11 +78,16 @@ index 0000000000000000000000000000000000000000..b0a5bfbebb3ad1598ba4164a8f263586 + + @Override + public void onLoaded() { -+ cachePlayerProfileResult = config.getBoolean(getBasePath() + ".cache-player-profile-result", cachePlayerProfileResult, """ ++ cachePlayerProfileResult = config.getBoolean(getBasePath() + ".cache-player-profile-result", cachePlayerProfileResult, config.pickStringRegionBased(""" + Cache the player profile result on they first join. -+ It's useful if Mojang's verification server is down. -+ """); ++ It's useful if Mojang's verification server is down.""", ++ """ ++ 玩家首次加入时缓存 PlayerProfile. ++ 正版验证服务器宕机时非常有用.""")); + cachePlayerProfileResultTimeout = config.getInt(getBasePath() + ".cache-player-profile-result-timeout", cachePlayerProfileResultTimeout, -+ "The timeout of the cache. Unit: Minutes."); ++ config.pickStringRegionBased( ++ "The timeout of the cache. Unit: Minutes.", ++ "缓存过期时间. 单位: 分钟." ++ )); + } +} diff --git a/patches/server/0080-Prevent-change-non-editable-sign-warning-spam-in-con.patch b/patches/server/0080-Prevent-change-non-editable-sign-warning-spam-in-con.patch index 2a6a960cb..7c7eac417 100644 --- a/patches/server/0080-Prevent-change-non-editable-sign-warning-spam-in-con.patch +++ b/patches/server/0080-Prevent-change-non-editable-sign-warning-spam-in-con.patch @@ -19,10 +19,10 @@ index c9a1c071780351b584ad8e071ddc26f9a27e5964..b17defc83411c3528cae1930136e771c } diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveChangeNonEditableSignWarning.java b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveChangeNonEditableSignWarning.java new file mode 100644 -index 0000000000000000000000000000000000000000..07f1cdbdd2dcbbbe33e4049a61799f47774f083e +index 0000000000000000000000000000000000000000..2f24d3e101e4e7517ca1927dcfef85d2e5b034b3 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveChangeNonEditableSignWarning.java -@@ -0,0 +1,19 @@ +@@ -0,0 +1,22 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -39,6 +39,9 @@ index 0000000000000000000000000000000000000000..07f1cdbdd2dcbbbe33e4049a61799f47 + @Override + public void onLoaded() { + enabled = config.getBoolean(getBasePath() + ".remove-change-non-editable-sign-warning", enabled, -+ "Enable to prevent console spam."); ++ config.pickStringRegionBased( ++ "Enable to prevent console spam.", ++ "移除修改无法编辑的告示牌时输出的警告." ++ )); + } +} diff --git a/patches/server/0081-Matter-Secure-Seed.patch b/patches/server/0081-Matter-Secure-Seed.patch index c239b3b18..7da881220 100644 --- a/patches/server/0081-Matter-Secure-Seed.patch +++ b/patches/server/0081-Matter-Secure-Seed.patch @@ -472,10 +472,10 @@ index c566f8f47918ea841659060661794315c690cf4c..9bfa1d398fb52835e738ff48daf006b4 DedicatedServerProperties.WorldDimensionData properties = new DedicatedServerProperties.WorldDimensionData(GsonHelper.parse((creator.generatorSettings().isEmpty()) ? "{}" : creator.generatorSettings()), creator.type().name().toLowerCase(Locale.ROOT)); diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/SecureSeed.java b/src/main/java/org/dreeam/leaf/config/modules/misc/SecureSeed.java new file mode 100644 -index 0000000000000000000000000000000000000000..0bbf188fbded9d67d2c07e5ee38f1af1a4619921 +index 0000000000000000000000000000000000000000..eb509447851b301e5e69c8ada9f8b268861e2fe3 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/SecureSeed.java -@@ -0,0 +1,22 @@ +@@ -0,0 +1,24 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -491,9 +491,11 @@ index 0000000000000000000000000000000000000000..0bbf188fbded9d67d2c07e5ee38f1af1 + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + Once you enable secure seed, all ores and structures are generated with 1024-bit seed -+ instead of using 64-bit seed in vanilla, made seed cracker become impossible."""); ++ instead of using 64-bit seed in vanilla, made seed cracker become impossible.""", ++ """ ++ 安全种子开启后, 所有矿物与结构都将使用1024位的种子进行生成, 无法被破解."""); + + enabled = config.getBoolean(getBasePath() + ".enabled", enabled); + } diff --git a/patches/server/0086-Faster-Random-Generator.patch b/patches/server/0086-Faster-Random-Generator.patch index b1bca2ca6..55d8d1c35 100644 --- a/patches/server/0086-Faster-Random-Generator.patch +++ b/patches/server/0086-Faster-Random-Generator.patch @@ -68,10 +68,10 @@ index c6efe6faf68c7a7b1df344e2e527aa7e44bfacb8..fe89e7b7c4267ee2969d1505f83cba1a public static enum Algorithm { diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/FastRNG.java b/src/main/java/org/dreeam/leaf/config/modules/opt/FastRNG.java new file mode 100644 -index 0000000000000000000000000000000000000000..4e980c7a90cb6f9ccd43ec1498dea90940208afd +index 0000000000000000000000000000000000000000..1c90bcfef92a383ee16f551c5a5bff3e9d013e7f --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/FastRNG.java -@@ -0,0 +1,40 @@ +@@ -0,0 +1,49 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -90,17 +90,26 @@ index 0000000000000000000000000000000000000000..4e980c7a90cb6f9ccd43ec1498dea909 + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + Use faster random generator? (Up to 100X faster) + Requires a JVM that supports RandomGenerator and the LXM generators. -+ Some JREs don't support this and will cause a crash."""); ++ Some JREs don't support this and will cause a crash.""", ++ """ ++ 是否使用更快的随机生成器? (速度最高可提升至100倍) ++ 需要支持 RandomGenerator 和 LXM 随机生成器的JVM. ++ 一些 JRE 不支持此功能, 会导致崩溃."""); + + enabled = config.getBoolean(getBasePath() + ".enabled", enabled); + warnForSlimeChunk = config.getBoolean(getBasePath() + ".warn-for-slime-chunk", warnForSlimeChunk, -+ "Warn if you are not using legacy random source for slime chunk generation."); -+ useLegacyForSlimeChunk = config.getBoolean(getBasePath() + ".use-legacy-random-for-slime-chunk", useLegacyForSlimeChunk, """ ++ config.pickStringRegionBased( ++ "Warn if you are not using legacy random source for slime chunk generation.", ++ "是否在没有为史莱姆区块使用原版随机生成器的情况下进行警告.")); ++ useLegacyForSlimeChunk = config.getBoolean(getBasePath() + ".use-legacy-random-for-slime-chunk", useLegacyForSlimeChunk, config.pickStringRegionBased( ++ """ + Use legacy random source for slime chunk generation, -+ to follow vanilla behavior."""); ++ to follow vanilla behavior.""", ++ """ ++ 是否使用原版随机生成器来生成史莱姆区块.""")); + + if (enabled && warnForSlimeChunk) { + LeafConfig.LOGGER.warn("You enabled faster random generator, it will offset location of slime chunk"); diff --git a/patches/server/0087-Don-t-save-primed-tnt-entity.patch b/patches/server/0087-Don-t-save-primed-tnt-entity.patch index 96a1ae263..08c670388 100644 --- a/patches/server/0087-Don-t-save-primed-tnt-entity.patch +++ b/patches/server/0087-Don-t-save-primed-tnt-entity.patch @@ -22,10 +22,10 @@ index 2a4425d04917b32c7ae5af3e7422c0bafc2aa1c2..2493e94b170dc5c0a3c36dded8e1ac39 } diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java new file mode 100644 -index 0000000000000000000000000000000000000000..1788d587215397b32c21815778cd1d0fe39e1f2b +index 0000000000000000000000000000000000000000..43c9fcc5a27d523d00656e058c46c34f36da8b63 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java -@@ -0,0 +1,22 @@ +@@ -0,0 +1,26 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -41,10 +41,14 @@ index 0000000000000000000000000000000000000000..1788d587215397b32c21815778cd1d0f + + @Override + public void onLoaded() { -+ dontSavePrimedTNT = config.getBoolean(getBasePath() + ".dont-save-primed-tnt", dontSavePrimedTNT, """ ++ dontSavePrimedTNT = config.getBoolean(getBasePath() + ".dont-save-primed-tnt", dontSavePrimedTNT, ++ config.pickStringRegionBased( ++ """ + Disable save primed tnt on chunk unloads. + Useful for redstone/technical servers, can prevent machines from being exploded by TNT, -+ when player disconnected caused by Internet issue. -+ """); ++ when player disconnected caused by Internet issue.""", ++ """ ++ 区块卸载时不保存掉落的方块和激活的 TNT, ++ 可以避免在玩家掉线时机器被炸毁.""")); + } +} diff --git a/patches/server/0088-Don-t-save-falling-block-entity.patch b/patches/server/0088-Don-t-save-falling-block-entity.patch index de586133e..d96efdfe8 100644 --- a/patches/server/0088-Don-t-save-falling-block-entity.patch +++ b/patches/server/0088-Don-t-save-falling-block-entity.patch @@ -21,7 +21,7 @@ index b83be9bbb9f348da83c0fd1ecc7f65c8a58b45b9..5b3844f92caf2962be58e911f98a26e6 + // Leaf end - PMC - Don't save falling block entity } diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java -index 1788d587215397b32c21815778cd1d0fe39e1f2b..f4af7ccf4e8bbdb803fb17de57bd523ea8ff7ef4 100644 +index 43c9fcc5a27d523d00656e058c46c34f36da8b63..28dc5e191a26a4783d9e8c18b2653b9ed3238a88 100644 --- a/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java @@ -10,6 +10,7 @@ public class DontSaveEntity extends ConfigModules { @@ -32,10 +32,10 @@ index 1788d587215397b32c21815778cd1d0fe39e1f2b..f4af7ccf4e8bbdb803fb17de57bd523e @Override public void onLoaded() { -@@ -18,5 +19,6 @@ public class DontSaveEntity extends ConfigModules { - Useful for redstone/technical servers, can prevent machines from being exploded by TNT, - when player disconnected caused by Internet issue. - """); +@@ -22,5 +23,6 @@ public class DontSaveEntity extends ConfigModules { + """ + 区块卸载时不保存掉落的方块和激活的 TNT, + 可以避免在玩家掉线时机器被炸毁.""")); + dontSaveFallingBlock = config.getBoolean(getBasePath() + ".dont-save-falling-block", dontSaveFallingBlock); } } diff --git a/patches/server/0089-Configurable-connection-message.patch b/patches/server/0089-Configurable-connection-message.patch index 41d2531eb..7a14cd5f5 100644 --- a/patches/server/0089-Configurable-connection-message.patch +++ b/patches/server/0089-Configurable-connection-message.patch @@ -67,10 +67,10 @@ index 2cdfd22baf31df99e2c2b1d114c47cb88569538f..8e3bbc7a0cf2a3e5999738c0f764544f } diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/ConnectionMessage.java b/src/main/java/org/dreeam/leaf/config/modules/misc/ConnectionMessage.java new file mode 100644 -index 0000000000000000000000000000000000000000..d05c123143ff623ce45c351a487e10ba52c92a61 +index 0000000000000000000000000000000000000000..72782ef6159a718b4d751a65db92812402cfab61 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/ConnectionMessage.java -@@ -0,0 +1,31 @@ +@@ -0,0 +1,41 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -89,16 +89,26 @@ index 0000000000000000000000000000000000000000..d05c123143ff623ce45c351a487e10ba + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + Connection message, using MiniMessage format, set to "default" to use vanilla join message. + available placeholders: + %player_name% - player name -+ %player_displayname% - player display name"""); ++ %player_displayname% - player display name""", ++ """ ++ 自定义加入 & 退出消息 (MiniMessage 格式), 设置为 'default' 将使用原版消息. ++ 可用的内置变量: ++ %player_name% - 玩家名称 ++ %player_displayname% - 玩家显示名称"""); + + joinEnabled = config.getBoolean(getBasePath() + ".join.enabled", joinEnabled); -+ joinMessage = config.getString(getBasePath() + ".join.message", joinMessage, "Join message of player"); ++ joinMessage = config.getString(getBasePath() + ".join.message", joinMessage, config.pickStringRegionBased( ++ "Join message of player", ++ "玩家加入服务器时的消息" ++ )); + + quitEnabled = config.getBoolean(getBasePath() + ".quit.enabled", quitEnabled); -+ quitMessage = config.getString(getBasePath() + ".quit.message", quitMessage, "Quit message of player"); ++ quitMessage = config.getString(getBasePath() + ".quit.message", quitMessage, config.pickStringRegionBased( ++ "Quit message of player", ++ "玩家退出服务器时的消息")); + } +} diff --git a/patches/server/0090-Configurable-unknown-command-message.patch b/patches/server/0090-Configurable-unknown-command-message.patch index 62c05be02..73fdbb262 100644 --- a/patches/server/0090-Configurable-unknown-command-message.patch +++ b/patches/server/0090-Configurable-unknown-command-message.patch @@ -135,10 +135,10 @@ index 91eea05a68d0ace8678fc5071e67cedb18a4386b..64d22c2be510ad759bcd6fe192d1ea8c com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher = (new Commands(Commands.CommandSelection.ALL, commandbuildcontext)).getDispatcher(); diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/UnknownCommandMessage.java b/src/main/java/org/dreeam/leaf/config/modules/misc/UnknownCommandMessage.java new file mode 100644 -index 0000000000000000000000000000000000000000..d54e1aee7421129b25b7a4ce8027816d76e3c368 +index 0000000000000000000000000000000000000000..66fbab025b1eae951d5318e3d11df5dd2cc85854 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/UnknownCommandMessage.java -@@ -0,0 +1,21 @@ +@@ -0,0 +1,23 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -154,10 +154,12 @@ index 0000000000000000000000000000000000000000..d54e1aee7421129b25b7a4ce8027816d + + @Override + public void onLoaded() { -+ unknownCommandMessage = config.getString(getBasePath() + ".unknown-command", unknownCommandMessage, """ ++ unknownCommandMessage = config.getString(getBasePath() + ".unknown-command", unknownCommandMessage, config.pickStringRegionBased(""" + Unknown command message, using MiniMessage format, set to "default" to use vanilla message, -+ placeholder: , shows detail of the unknown command information. -+ """); ++ placeholder: , shows detail of the unknown command information.""", ++ """ ++ 发送未知命令时的消息, 使用 MiniMessage 格式, 设置为 "default" 使用原版消息. ++ 变量: , 显示未知命令详细信息.""")); + } +} diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/patches/server/0108-Do-not-place-player-if-the-server-is-full.patch b/patches/server/0108-Do-not-place-player-if-the-server-is-full.patch index e6c12f321..8c855b4a8 100644 --- a/patches/server/0108-Do-not-place-player-if-the-server-is-full.patch +++ b/patches/server/0108-Do-not-place-player-if-the-server-is-full.patch @@ -34,10 +34,10 @@ index 8e3bbc7a0cf2a3e5999738c0f764544f5e64ef4a..a7fadf66ff2935c6a3751f2121b0e1a8 } diff --git a/src/main/java/org/dreeam/leaf/config/modules/fixes/DontPlacePlayerIfFull.java b/src/main/java/org/dreeam/leaf/config/modules/fixes/DontPlacePlayerIfFull.java new file mode 100644 -index 0000000000000000000000000000000000000000..8ca0c6ef982fa45891e67430c729eb1c92235853 +index 0000000000000000000000000000000000000000..ae21bcac9d57b760d751d25f2bdb746e4bd636f1 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/fixes/DontPlacePlayerIfFull.java -@@ -0,0 +1,21 @@ +@@ -0,0 +1,25 @@ +package org.dreeam.leaf.config.modules.fixes; + +import org.dreeam.leaf.config.ConfigModules; @@ -53,9 +53,13 @@ index 0000000000000000000000000000000000000000..8ca0c6ef982fa45891e67430c729eb1c + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath() + ".dont-place-player-if-server-full", enabled, """ ++ enabled = config.getBoolean(getBasePath() + ".dont-place-player-if-server-full", enabled, config.pickStringRegionBased(""" + Don't let player join server if the server is full. + If enable this, you should use 'purpur.joinfullserver' permission instead of -+ PlayerLoginEvent#allow to let player join full server."""); ++ PlayerLoginEvent#allow to let player join full server.""", ++ """ ++ 服务器已满时禁止玩家加入. ++ 开启后需使用权限 'purpur.joinfullserver' 而不是 ++ PlayerLoginEvent#allow 让玩家进入已满的服务器.""")); + } +} diff --git a/patches/server/0116-Cache-CraftEntityType-minecraftToBukkit-convert.patch b/patches/server/0116-Cache-CraftEntityType-minecraftToBukkit-convert.patch index c706d6423..9ee47ee59 100644 --- a/patches/server/0116-Cache-CraftEntityType-minecraftToBukkit-convert.patch +++ b/patches/server/0116-Cache-CraftEntityType-minecraftToBukkit-convert.patch @@ -210,10 +210,10 @@ index 4270b771ff15d398b4788cb2fe27236989077614..97a87083f651434e51a9176009230e09 } diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/EnableCachedMTBEntityTypeConvert.java b/src/main/java/org/dreeam/leaf/config/modules/opt/EnableCachedMTBEntityTypeConvert.java new file mode 100644 -index 0000000000000000000000000000000000000000..0cab66307bc6892624c40d475e520c2b71a73d6d +index 0000000000000000000000000000000000000000..68ec35730c4d50602c85a502bc25d6a7cbc4a45b --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/opt/EnableCachedMTBEntityTypeConvert.java -@@ -0,0 +1,18 @@ +@@ -0,0 +1,21 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; @@ -229,6 +229,9 @@ index 0000000000000000000000000000000000000000..0cab66307bc6892624c40d475e520c2b + + @Override + public void onLoaded() { -+ enabled = config.getBoolean(getBasePath() + ".enable-cached-minecraft-to-bukkit-entitytype-convert", enabled); ++ enabled = config.getBoolean(getBasePath() + ".enable-cached-minecraft-to-bukkit-entitytype-convert", enabled, config.pickStringRegionBased(""" ++ Whether to cache expensive CraftEntityType#minecraftToBukkit call.""", ++ """ ++ 是否缓存Minecraft到Bukkit的实体类型转换.""")); + } +} diff --git a/patches/server/0117-Configurable-player-knockback-zombie.patch b/patches/server/0117-Configurable-player-knockback-zombie.patch index dba7ebd2c..2e4b26789 100644 --- a/patches/server/0117-Configurable-player-knockback-zombie.patch +++ b/patches/server/0117-Configurable-player-knockback-zombie.patch @@ -39,7 +39,7 @@ index 21fbf1f88dbf8e767549a8fd0a7e9a8e0e434d54..042e9075bd1b62f9f25647502aad496a @Nullable diff --git a/src/main/java/org/dreeam/leaf/config/modules/gameplay/Knockback.java b/src/main/java/org/dreeam/leaf/config/modules/gameplay/Knockback.java -index 35e8a9568cd37f4ed75d10a38beea996c8729388..df26a6e47fba5781000bafbda735629f9057971f 100644 +index 7b434158818834450ea43611e2ab5636917bb938..3499b1e60bde373bff79f007990fdd1a88fa48bf 100644 --- a/src/main/java/org/dreeam/leaf/config/modules/gameplay/Knockback.java +++ b/src/main/java/org/dreeam/leaf/config/modules/gameplay/Knockback.java @@ -11,6 +11,7 @@ public class Knockback extends ConfigModules { @@ -50,11 +50,14 @@ index 35e8a9568cd37f4ed75d10a38beea996c8729388..df26a6e47fba5781000bafbda735629f @Override public void onLoaded() { -@@ -18,5 +19,7 @@ public class Knockback extends ConfigModules { - "Make snowball can knockback players"); - eggCanKnockback = config.getBoolean(getBasePath() + ".egg-knockback-players", eggCanKnockback, - "Make egg can knockback players"); +@@ -24,5 +25,10 @@ public class Knockback extends ConfigModules { + "Make egg can knockback players.", + "使鸡蛋可以击退玩家." + )); + canPlayerKnockbackZombie = config.getBoolean(getBasePath() + ".can-player-knockback-zombie", canPlayerKnockbackZombie, -+ "Make players can knockback zombie"); ++ config.pickStringRegionBased( ++ "Make players can knockback zombie.", ++ "使玩家可以击退僵尸." ++ )); } } diff --git a/patches/server/0118-Hide-specified-item-components-to-clients.patch b/patches/server/0118-Hide-specified-item-components-to-clients.patch index 39d97a9d4..2a2478123 100644 --- a/patches/server/0118-Hide-specified-item-components-to-clients.patch +++ b/patches/server/0118-Hide-specified-item-components-to-clients.patch @@ -132,10 +132,10 @@ index ecfa807e78c16a24099d40becd0c7916f239aed1..f1b4adeeb4dad5178a5e52870f420bea this.synchronizer.sendCarriedChange(this, this.remoteCarried); diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/HiddenItemComponents.java b/src/main/java/org/dreeam/leaf/config/modules/misc/HiddenItemComponents.java new file mode 100644 -index 0000000000000000000000000000000000000000..c51c12efe6fdc360d8d6e0ea41ecaaaa6969fa7b +index 0000000000000000000000000000000000000000..f89b21cbe62d66afd61c7a61d3a126a5dfda373e --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/HiddenItemComponents.java -@@ -0,0 +1,45 @@ +@@ -0,0 +1,51 @@ +package org.dreeam.leaf.config.modules.misc; + +import net.minecraft.core.component.DataComponentType; @@ -158,14 +158,20 @@ index 0000000000000000000000000000000000000000..c51c12efe6fdc360d8d6e0ea41ecaaaa + + @Override + public void onLoaded() { -+ List list = config.getList(getBasePath() + ".hidden-item-components", new ArrayList<>(), """ ++ List list = config.getList(getBasePath() + ".hidden-item-components", new ArrayList<>(), config.pickStringRegionBased(""" + Controls whether specified component information is sent to clients. + This may break resource packs and mods that rely on this information. + It needs a component type list, incorrect things will not work. + You can fill it with ["custom_data"] to hide components of CUSTOM_DATA. + Also, it can avoid some frequent client animations. -+ NOTICE: You must know what you're filling in and how it works! It will handle all itemStacks! -+ """); ++ NOTICE: You must know what you're filling in and how it works! It will handle all itemStacks!""", ++ """ ++ 控制哪些物品组件信息会被发送至客户端. ++ 可能会导致依赖物品组件的资源包/模组无法正常工作. ++ 该配置项接受一个物品组件列表, 格式不正确将不会启用. ++ 可以填入 ["custom_data"] 来隐藏自定义数据物品组件 CUSTOM_DATA. ++ 也可以避免一些客户端动画效果. ++ 注意: 你必须知道你填进去的是什么, 有什么用, 该项配置会处理所有的ItemStack!""")); + + List> types = new ArrayList<>(list.size()); + diff --git a/patches/server/0125-Multithreaded-Tracker.patch b/patches/server/0125-Multithreaded-Tracker.patch index c2c67c9e1..4105c4ca6 100644 --- a/patches/server/0125-Multithreaded-Tracker.patch +++ b/patches/server/0125-Multithreaded-Tracker.patch @@ -556,10 +556,10 @@ index 0000000000000000000000000000000000000000..1ecaa9f4b4843c05af2139ae3e4b0dd0 +} diff --git a/src/main/java/org/dreeam/leaf/config/modules/async/MultithreadedTracker.java b/src/main/java/org/dreeam/leaf/config/modules/async/MultithreadedTracker.java new file mode 100644 -index 0000000000000000000000000000000000000000..83e549e990664b87a279cb795e3f4b4b2768ca68 +index 0000000000000000000000000000000000000000..bf253dbdcff603a4ebce181bf75131dd8aa52721 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/async/MultithreadedTracker.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,48 @@ +package org.dreeam.leaf.config.modules.async; + +import org.dreeam.leaf.config.ConfigModules; @@ -579,16 +579,21 @@ index 0000000000000000000000000000000000000000..83e549e990664b87a279cb795e3f4b4b + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + Make entity tracking saving asynchronously, can improve performance significantly, -+ especially in some massive entities in small area situations. -+ """); ++ especially in some massive entities in small area situations.""", ++ """ ++ 异步实体跟踪, ++ 在实体数量多且密集的情况下效果明显."""); + + enabled = config().getBoolean(getBasePath() + ".enabled", enabled); -+ compatModeEnabled = config.getBoolean(getBasePath() + ".compat-mode", compatModeEnabled, """ ++ compatModeEnabled = config.getBoolean(getBasePath() + ".compat-mode", compatModeEnabled, config.pickStringRegionBased(""" + Enable compat mode ONLY if Citizens or NPC plugins using real entity has installed, + Compat mode fixed visible issue with player type NPCs of Citizens, -+ But still recommend to use packet based / virtual entity NPC plugin, e.g. ZNPC Plus, Adyeshach, Fancy NPC or else."""); ++ But still recommend to use packet based / virtual entity NPC plugin, e.g. ZNPC Plus, Adyeshach, Fancy NPC or else.""", ++ """ ++ 是否启用兼容模式, ++ 如果你的服务器安装了 Citizens 或其他类似非发包 NPC 插件, 请开启此项.""")); + asyncEntityTrackerMaxThreads = config.getInt(getBasePath() + ".max-threads", asyncEntityTrackerMaxThreads); + asyncEntityTrackerKeepalive = config.getInt(getBasePath() + ".keepalive", asyncEntityTrackerKeepalive); + diff --git a/patches/server/0126-Nitori-Async-playerdata-Save.patch b/patches/server/0126-Nitori-Async-playerdata-Save.patch index 729cb5202..d602c5bb8 100644 --- a/patches/server/0126-Nitori-Async-playerdata-Save.patch +++ b/patches/server/0126-Nitori-Async-playerdata-Save.patch @@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..6f74ca2f5bdae24434255976ec24f28c +} diff --git a/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java b/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java new file mode 100644 -index 0000000000000000000000000000000000000000..91c7bafe45ac9247b26d9781dcb6b80b92fad2b8 +index 0000000000000000000000000000000000000000..11f990fac56e6d61d59ebddf09fc27cd986a979f --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java -@@ -0,0 +1,20 @@ +@@ -0,0 +1,22 @@ +package org.dreeam.leaf.config.modules.async; + +import org.dreeam.leaf.config.ConfigModules; @@ -104,7 +104,9 @@ index 0000000000000000000000000000000000000000..91c7bafe45ac9247b26d9781dcb6b80b + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), "Make PlayerData saving asynchronously."); ++ config.addCommentRegionBased(getBasePath(), ++ "Make PlayerData saving asynchronously.", ++ "异步保存玩家数据."); + + enabled = config().getBoolean(getBasePath() + ".enabled", enabled); + } diff --git a/patches/server/0127-Change-max-stack-count.patch b/patches/server/0127-Change-max-stack-count.patch index 6e8d038a5..55183db52 100644 --- a/patches/server/0127-Change-max-stack-count.patch +++ b/patches/server/0127-Change-max-stack-count.patch @@ -116,10 +116,10 @@ index 4901f0d89ae2472bce7f242d9529236674f5d134..127f41511cdcaacc00e0f128c20339f3 } diff --git a/src/main/java/org/dreeam/leaf/config/modules/gameplay/MaxItemsStackCount.java b/src/main/java/org/dreeam/leaf/config/modules/gameplay/MaxItemsStackCount.java new file mode 100644 -index 0000000000000000000000000000000000000000..4a895897111454dc3558aa491b9d81cf610b5bbf +index 0000000000000000000000000000000000000000..434a938cb1e2ac906783be2507fa7846f2f013a2 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/gameplay/MaxItemsStackCount.java -@@ -0,0 +1,25 @@ +@@ -0,0 +1,27 @@ +package org.dreeam.leaf.config.modules.gameplay; + +import org.dreeam.leaf.config.ConfigModules; @@ -136,7 +136,9 @@ index 0000000000000000000000000000000000000000..4a895897111454dc3558aa491b9d81cf + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), "Don't touch this unless you know what you are doing!"); ++ config.addCommentRegionBased(getBasePath(), ++ "Don't touch this unless you know what you are doing!", ++ "不要动该项, 除非你知道自己在做什么!"); + + maxItemStackCount = config.getInt(getBasePath() + ".max-dropped-items-stack-count", maxItemStackCount); + maxContainerDestroyCount = config.getInt(getBasePath() + ".max-container-destroy-count", maxContainerDestroyCount); diff --git a/patches/server/0131-Asynchronous-locator.patch b/patches/server/0131-Asynchronous-locator.patch index c61777836..b985904e0 100644 --- a/patches/server/0131-Asynchronous-locator.patch +++ b/patches/server/0131-Asynchronous-locator.patch @@ -418,10 +418,10 @@ index 0000000000000000000000000000000000000000..0eaa9b60ac139db47a028970557c3a84 \ No newline at end of file diff --git a/src/main/java/org/dreeam/leaf/config/modules/async/AsyncLocator.java b/src/main/java/org/dreeam/leaf/config/modules/async/AsyncLocator.java new file mode 100644 -index 0000000000000000000000000000000000000000..33bf0155cac0776457f124f7815b7e9ecc2ef8da +index 0000000000000000000000000000000000000000..0a2e562af7f7b08f6e95702f26f97f2c6f6aeb02 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/async/AsyncLocator.java -@@ -0,0 +1,35 @@ +@@ -0,0 +1,37 @@ +package org.dreeam.leaf.config.modules.async; + +import org.dreeam.leaf.config.ConfigModules; @@ -439,11 +439,13 @@ index 0000000000000000000000000000000000000000..33bf0155cac0776457f124f7815b7e9e + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ -+ ***Experimental feature, report any bugs you encounter!*** ++ config.addCommentRegionBased(getBasePath(), """ + Whether or not asynchronous locator should be enabled. + This offloads structure locating to other threads. -+ Only for locate command, dolphin treasure finding and eye of ender currently."""); ++ Only for locate command, dolphin treasure finding and eye of ender currently.""", ++ """ ++ 是否启用异步结构搜索. ++ 目前可用于 /locate 指令, 海豚寻宝和末影之眼."""); + enabled = config.getBoolean(getBasePath() + ".enabled", enabled); + asyncLocatorThreads = config.getInt(getBasePath() + ".threads", asyncLocatorThreads); + diff --git a/patches/server/0138-TT20-Lag-compensation.patch b/patches/server/0138-TT20-Lag-compensation.patch index c60f413d5..af02cabe5 100644 --- a/patches/server/0138-TT20-Lag-compensation.patch +++ b/patches/server/0138-TT20-Lag-compensation.patch @@ -63,10 +63,10 @@ index 9dcdb2f4001115db0c26fdbf86531dbe6098485d..53a28a4026c50a66e53241ffe660b4d7 @Override diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/LagCompensation.java b/src/main/java/org/dreeam/leaf/config/modules/misc/LagCompensation.java new file mode 100644 -index 0000000000000000000000000000000000000000..d90ab4cb8c69318f8bf77af12e2840fb5d519931 +index 0000000000000000000000000000000000000000..73b9199b0b5ba2daeda2984a07daefdd49351625 --- /dev/null +++ b/src/main/java/org/dreeam/leaf/config/modules/misc/LagCompensation.java -@@ -0,0 +1,26 @@ +@@ -0,0 +1,29 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; @@ -84,9 +84,12 @@ index 0000000000000000000000000000000000000000..d90ab4cb8c69318f8bf77af12e2840fb + + @Override + public void onLoaded() { -+ config.addComment(getBasePath(), """ ++ config.addCommentRegionBased(getBasePath(), """ + This section contains lag compensation features, -+ which could ensure basic playing experience during a lag."""); ++ which could ensure basic playing experience during a lag.""", ++ """ ++ 这部分包含滞后补偿功能, ++ 可以在卡顿情况下保障基本游戏体验."""); + + enabled = config.getBoolean(getBasePath() + ".enabled", enabled); + enableForWater = config.getBoolean(getBasePath() + ".enable-for-water", enableForWater);