Skip to content

Commit

Permalink
Requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Dec 1, 2024
1 parent c926acb commit 4f0db40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 7 additions & 3 deletions patches/server/0003-Leaf-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ index 4efbd656c57672b84c5d90f987bd57c67fc0c550..05f805c7e7a6ff6d40b9f86aaac5362a
long tickSection = Util.getNanos();
diff --git a/src/main/java/org/dreeam/leaf/config/ConfigModules.java b/src/main/java/org/dreeam/leaf/config/ConfigModules.java
new file mode 100644
index 0000000000000000000000000000000000000000..0ea0cbf819d1756909729e2f923b235f0842183d
index 0000000000000000000000000000000000000000..475da1247655dd07ab59273ab5794b04b20e05ed
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/config/ConfigModules.java
@@ -0,0 +1,53 @@
@@ -0,0 +1,57 @@
+package org.dreeam.leaf.config;
+
+import org.dreeam.leaf.config.annotations.Experimental;
Expand All @@ -83,6 +83,7 @@ index 0000000000000000000000000000000000000000..0ea0cbf819d1756909729e2f923b235f
+ }
+
+ public static void initModules() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
+ List<Class<?>> enabledExperimentalModules = new ArrayList<>();
+ for (Class<?> clazz : LeafConfig.getClasses(LeafConfig.I_CONFIG_PKG)) {
+ ConfigModules module = (ConfigModules) clazz.getConstructor().newInstance();
+ module.onLoaded();
Expand All @@ -93,11 +94,14 @@ index 0000000000000000000000000000000000000000..0ea0cbf819d1756909729e2f923b235f
+ if (!(obj instanceof Boolean)) continue;
+ boolean enabled = (Boolean) obj;
+ if (enabled) {
+ LeafConfig.LOGGER.warn("Experimental feature {} is enabled, please report any bugs you found!", clazz.getSimpleName());
+ enabledExperimentalModules.add(clazz);
+ break;
+ }
+ }
+ }
+ if (!enabledExperimentalModules.isEmpty()) {
+ LeafConfig.LOGGER.warn("You have following experimental module(s) enabled: {}, please report any bugs you found!", enabledExperimentalModules.stream().map(Class::getSimpleName).toList());
+ }
+ }
+
+ private static List<Field> getAnnotatedStaticFields(Class<?> clazz, Class<? extends Annotation> annotation) {
Expand Down
7 changes: 5 additions & 2 deletions patches/server/0049-Linear-region-file-format.patch
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,16 @@ 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..e7a38c0102fd4838a17a590a50487fd231ca36ca
index 0000000000000000000000000000000000000000..d94f8dd4a8682125ea356d36632e2b68e73d8af3
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/config/modules/misc/RegionFormatConfig.java
@@ -0,0 +1,59 @@
@@ -0,0 +1,62 @@
+package org.dreeam.leaf.config.modules.misc;
+
+import com.mojang.logging.LogUtils;
+import org.dreeam.leaf.config.ConfigModules;
+import org.dreeam.leaf.config.EnumConfigCategory;
+import org.dreeam.leaf.config.annotations.DoNotLoad;
+import org.slf4j.Logger;
+import org.stupidcraft.linearpaper.region.EnumRegionFileExtension;
+
Expand All @@ -350,7 +351,9 @@ index 0000000000000000000000000000000000000000..e7a38c0102fd4838a17a590a50487fd2
+ return EnumConfigCategory.MISC.getBaseKeyName() + ".region-format-settings";
+ }
+
+ @DoNotLoad
+ private static final Logger logger = LogUtils.getLogger();
+ @DoNotLoad
+ public static EnumRegionFileExtension regionFormatType;
+
+ public static String regionFormatTypeName = "MCA";
Expand Down

0 comments on commit 4f0db40

Please sign in to comment.