feat: update @interface to allow comments extend
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
+++ b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
||||||
@@ -1,0 +_,271 @@
|
@@ -1,0 +_,275 @@
|
||||||
+package me.earthme.luminol.config;
|
+package me.earthme.luminol.config;
|
||||||
+
|
+
|
||||||
+import com.electronwill.nightconfig.core.UnmodifiableConfig;
|
+import com.electronwill.nightconfig.core.UnmodifiableConfig;
|
||||||
@@ -146,6 +146,10 @@
|
|||||||
+ success = false;
|
+ success = false;
|
||||||
+ logger.error("Failed to transform removed config {}!", transformedConfig.name());
|
+ logger.error("Failed to transform removed config {}!", transformedConfig.name());
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ if (transformedConfig.transformComments()) {
|
||||||
|
+ configFileInstance.setComment(fullConfigKeyName, configFileInstance.getComment(oldConfigKeyName));
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (success) removeConfig(oldConfigKeyName, transformedConfig.category());
|
+ if (success) removeConfig(oldConfigKeyName, transformedConfig.category());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/earthme/luminol/config/TransformedConfig.java
|
+++ b/src/main/java/me/earthme/luminol/config/TransformedConfig.java
|
||||||
@@ -1,0 +_,22 @@
|
@@ -1,0 +_,24 @@
|
||||||
+package me.earthme.luminol.config;
|
+package me.earthme.luminol.config;
|
||||||
+
|
+
|
||||||
+import java.lang.annotation.Repeatable;
|
+import java.lang.annotation.Repeatable;
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
+
|
+
|
||||||
+ boolean transform() default true;
|
+ boolean transform() default true;
|
||||||
+
|
+
|
||||||
|
+ boolean transformComments() default true;
|
||||||
|
+
|
||||||
+ Class<? extends DefaultTransformLogic>[] transformLogic() default {DefaultTransformLogic.class};
|
+ Class<? extends DefaultTransformLogic>[] transformLogic() default {DefaultTransformLogic.class};
|
||||||
+
|
+
|
||||||
+ @Retention(RetentionPolicy.RUNTIME)
|
+ @Retention(RetentionPolicy.RUNTIME)
|
||||||
|
|||||||
Reference in New Issue
Block a user