9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-06 15:51:31 +00:00

Fix config loading issue caused by wrong default config key

This commit is contained in:
Dreeam
2024-08-09 19:51:44 +08:00
parent 572b7ecf5a
commit d8c2bb9abd
2 changed files with 8 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b5491374f17c93310cba14a29ade7f416dd68ab4..d0b8099b8ce299c44bbde9b8dd34ccd9312579e8 100644
index 8353c264597de5b1ddcc1643c87f6ea09a22523b..881f507ff6fcac86f8ef04cbd3ff10c41c840d52 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -701,6 +701,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -295,7 +295,7 @@ index 71a3eadd2f1e00fa066dbfe9918d749d43435a18..03513d3b6118ac5d0a58788462dcbc98
}
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..a69b2717f3af9d1d7297d14e79298e5635846c4f
index 0000000000000000000000000000000000000000..9fa2104554c3022c5189b6edb5768b3cd4963fb1
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/config/modules/opt/DynamicActivationofBrain.java
@@ -0,0 +1,53 @@
@@ -307,7 +307,7 @@ index 0000000000000000000000000000000000000000..a69b2717f3af9d1d7297d14e79298e56
+import org.dreeam.leaf.config.EnumConfigCategory;
+import org.dreeam.leaf.config.LeafConfig;
+
+import java.util.Collections;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DynamicActivationofBrain extends ConfigModules {
@@ -321,7 +321,7 @@ index 0000000000000000000000000000000000000000..a69b2717f3af9d1d7297d14e79298e56
+ public static int startDistanceSquared;
+ public static int maximumActivationPrio = 20;
+ public static int activationDistanceMod = 8;
+ public static List<String> blackedEntities = Collections.emptyList();
+ public static List<String> blackedEntities = new ArrayList<>();
+
+ @Override
+ public void onLoaded() {

View File

@@ -132,10 +132,10 @@ index c491291b522aebf34c7d990d2b485d1a0d19cdcd..267f638bb704002a30b1f5cb4e33b6a8
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..5847c24e127cd71aa026610c15f416aeff06feef
index 0000000000000000000000000000000000000000..c51c12efe6fdc360d8d6e0ea41ecaaaa6969fa7b
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/config/modules/misc/HiddenItemComponents.java
@@ -0,0 +1,46 @@
@@ -0,0 +1,45 @@
+package org.dreeam.leaf.config.modules.misc;
+
+import net.minecraft.core.component.DataComponentType;
@@ -146,7 +146,6 @@ index 0000000000000000000000000000000000000000..5847c24e127cd71aa026610c15f416ae
+import org.dreeam.leaf.config.LeafConfig;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class HiddenItemComponents extends ConfigModules {
@@ -155,11 +154,11 @@ index 0000000000000000000000000000000000000000..5847c24e127cd71aa026610c15f416ae
+ return EnumConfigCategory.MISC.getBaseKeyName();
+ }
+
+ public static List<DataComponentType<?>> hiddenItemComponentTypes = Collections.emptyList();
+ public static List<DataComponentType<?>> hiddenItemComponentTypes = List.of();
+
+ @Override
+ public void onLoaded() {
+ List<String> list = config.getList(getBasePath() + ".hidden-item-components", Collections.emptyList(), """
+ List<String> list = config.getList(getBasePath() + ".hidden-item-components", new ArrayList<>(), """
+ 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.