diff options
author | isXander <xander@isxander.dev> | 2024-02-29 22:22:46 +0000 |
---|---|---|
committer | isXander <xander@isxander.dev> | 2024-02-29 22:22:46 +0000 |
commit | 308d882fc015fd448deb059b2a814246f7a32f05 (patch) | |
tree | 257777901c4db53220d4ae4ea869426633a42b25 /common/src/main/java/dev/isxander/yacl3/config | |
parent | 0a10f11494db07f974b416c1f69184728b68374c (diff) | |
download | YetAnotherConfigLib-308d882fc015fd448deb059b2a814246f7a32f05.tar.gz YetAnotherConfigLib-308d882fc015fd448deb059b2a814246f7a32f05.tar.bz2 YetAnotherConfigLib-308d882fc015fd448deb059b2a814246f7a32f05.zip |
Start work on 1.20.5
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/config')
-rw-r--r-- | common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java | 5 | ||||
-rw-r--r-- | common/src/main/java/dev/isxander/yacl3/config/v2/impl/serializer/GsonConfigSerializer.java | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java b/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java index 4e7c931..91749ba 100644 --- a/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java +++ b/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java @@ -4,6 +4,7 @@ import com.google.gson.*; import dev.isxander.yacl3.config.v2.impl.serializer.GsonConfigSerializer; import dev.isxander.yacl3.gui.utils.ItemRegistryHelper; import dev.isxander.yacl3.impl.utils.YACLConstants; +import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Style; @@ -67,7 +68,7 @@ public class GsonConfigInstance<T> extends ConfigInstance<T> { this.path = path; this.gson = builder .setExclusionStrategies(new ConfigExclusionStrategy()) - .registerTypeHierarchyAdapter(Component.class, new Component.SerializerAdapter()) + .registerTypeHierarchyAdapter(Component.class, new Component.SerializerAdapter(RegistryAccess.EMPTY)) .registerTypeHierarchyAdapter(Style.class, new GsonConfigSerializer.StyleTypeAdapter()) .registerTypeHierarchyAdapter(Color.class, new ColorTypeAdapter()) .registerTypeHierarchyAdapter(Item.class, new ItemTypeAdapter()) @@ -162,7 +163,7 @@ public class GsonConfigInstance<T> extends ConfigInstance<T> { private UnaryOperator<GsonBuilder> gsonBuilder = builder -> builder .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .serializeNulls() - .registerTypeHierarchyAdapter(Component.class, new Component.SerializerAdapter()) + .registerTypeHierarchyAdapter(Component.class, new Component.SerializerAdapter(RegistryAccess.EMPTY)) .registerTypeHierarchyAdapter(Style.class, new GsonConfigSerializer.StyleTypeAdapter()) .registerTypeHierarchyAdapter(Color.class, new ColorTypeAdapter()) .registerTypeHierarchyAdapter(Item.class, new ItemTypeAdapter()); diff --git a/common/src/main/java/dev/isxander/yacl3/config/v2/impl/serializer/GsonConfigSerializer.java b/common/src/main/java/dev/isxander/yacl3/config/v2/impl/serializer/GsonConfigSerializer.java index d38fb73..8cd1ed4 100644 --- a/common/src/main/java/dev/isxander/yacl3/config/v2/impl/serializer/GsonConfigSerializer.java +++ b/common/src/main/java/dev/isxander/yacl3/config/v2/impl/serializer/GsonConfigSerializer.java @@ -9,6 +9,7 @@ import dev.isxander.yacl3.gui.utils.ItemRegistryHelper; import dev.isxander.yacl3.impl.utils.YACLConstants; import dev.isxander.yacl3.platform.YACLPlatform; import net.minecraft.commands.ParserUtils; +import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Style; @@ -220,7 +221,7 @@ public class GsonConfigSerializer<T> extends ConfigSerializer<T> { private UnaryOperator<GsonBuilder> gsonBuilder = builder -> builder .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .serializeNulls() - .registerTypeHierarchyAdapter(Component.class, new Component.SerializerAdapter()) + .registerTypeHierarchyAdapter(Component.class, new Component.SerializerAdapter(RegistryAccess.EMPTY)) .registerTypeHierarchyAdapter(Style.class, new StyleTypeAdapter()) .registerTypeHierarchyAdapter(Color.class, new ColorTypeAdapter()) .registerTypeHierarchyAdapter(Item.class, new ItemTypeAdapter()) |