From bc90a96e44b095b962670dd2933424d8e6c65d08 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 22 Mar 2024 18:52:30 +0000 Subject: [PATCH] Fixed trait serialization --- .../unicopia/ability/magic/spell/trait/Trait.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java index 341525b4..20b6e151 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/trait/Trait.java @@ -62,7 +62,7 @@ public enum Trait implements CommandArgumentEnum { private static final Map REGISTRY = Arrays.stream(values()).collect(Collectors.toMap(Trait::name, Function.identity())); private static final Map IDS = Arrays.stream(values()).collect(Collectors.toMap(Trait::getId, Function.identity())); - public static final com.mojang.serialization.Codec CODEC = StringIdentifiable.createCodec(Trait::values, n -> Unicopia.id(n.toLowerCase(Locale.ROOT)).toString()); + public static final com.mojang.serialization.Codec CODEC = StringIdentifiable.createCodec(Trait::values, n -> n.toLowerCase(Locale.ROOT)); public static final com.mojang.serialization.Codec> SET_CODEC = CODEC.listOf().xmap( l -> l.stream().distinct().collect(Collectors.toSet()), s -> s.stream().toList() @@ -109,7 +109,7 @@ public enum Trait implements CommandArgumentEnum { @Override public String asString() { - return name(); + return getId().getPath(); } public TraitGroup getGroup() {