Skip to content

Commit

Permalink
Mark async playerdata saving as experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Dec 10, 2024
1 parent 7a036bb commit 25f595e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions patches/server/0130-Nitori-Async-playerdata-Save.patch
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,34 @@ 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..11f990fac56e6d61d59ebddf09fc27cd986a979f
index 0000000000000000000000000000000000000000..148a75e8aa545145fe25638623145b0b585462b6
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java
@@ -0,0 +1,22 @@
@@ -0,0 +1,28 @@
+package org.dreeam.leaf.config.modules.async;
+
+import org.dreeam.leaf.config.ConfigModules;
+import org.dreeam.leaf.config.EnumConfigCategory;
+import org.dreeam.leaf.config.annotations.Experimental;
+
+public class AsyncPlayerDataSave extends ConfigModules {
+
+ public String getBasePath() {
+ return EnumConfigCategory.ASYNC.getBaseKeyName() + ".async-playerdata-save";
+ }
+
+ @Experimental
+ public static boolean enabled = false;
+
+ @Override
+ public void onLoaded() {
+ config.addCommentRegionBased(getBasePath(),
+ "Make PlayerData saving asynchronously.",
+ "异步保存玩家数据.");
+ """
+ **Experimental feature, may have data lost in some circumstances!**
+ Make PlayerData saving asynchronously.""",
+ """
+ **实验性功能, 在部分场景下可能丢失玩家数据!**
+ 异步保存玩家数据.""");
+
+ enabled = config().getBoolean(getBasePath() + ".enabled", enabled);
+ }
Expand Down

0 comments on commit 25f595e

Please sign in to comment.