Lortseam 4 rokov pred
rodič
commit
b5ebec7964

+ 2 - 2
lib/src/main/java/me/lortseam/completeconfig/data/Entry.java

@@ -141,9 +141,9 @@ public class Entry<T> implements DataPart, Identifiable, TooltipSupplier {
         if (translation == null) {
             Optional<ConfigEntry> annotation = origin.getOptionalAnnotation(ConfigEntry.class);
             if (annotation.isPresent() && !StringUtils.isBlank(annotation.get().translationKey())) {
-                translation = origin.getParentTranslation().append(annotation.get().translationKey());
+                translation = origin.getParent().getTranslation().append(annotation.get().translationKey());
             } else {
-                translation = origin.getParentTranslation().append(id);
+                translation = origin.getParent().getTranslation().append(id);
             }
         }
         return translation;

+ 1 - 8
lib/src/main/java/me/lortseam/completeconfig/data/EntryOrigin.java

@@ -4,10 +4,7 @@ import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import me.lortseam.completeconfig.api.ConfigContainer;
-import me.lortseam.completeconfig.data.text.TranslationKey;
 import me.lortseam.completeconfig.util.ReflectionUtils;
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
@@ -18,6 +15,7 @@ import java.util.Optional;
 @EqualsAndHashCode(onlyExplicitlyIncluded = true)
 public final class EntryOrigin {
 
+    @Getter
     private final BaseCollection parent;
     @Getter
     @EqualsAndHashCode.Include
@@ -26,11 +24,6 @@ public final class EntryOrigin {
     @EqualsAndHashCode.Include
     private final ConfigContainer object;
 
-    @Environment(EnvType.CLIENT)
-    public TranslationKey getParentTranslation() {
-        return parent.getTranslation();
-    }
-
     public Type getType() {
         return ReflectionUtils.getFieldType(field);
     }