فهرست منبع

Rename enum options annotation

Lortseam 4 سال پیش
والد
کامیت
eabd5b063a

+ 1 - 1
src/main/java/me/lortseam/completeconfig/api/ConfigEntry.java

@@ -70,7 +70,7 @@ public @interface ConfigEntry {
 
     @Target(ElementType.FIELD)
     @Retention(RetentionPolicy.RUNTIME)
-    @interface EnumOptions {
+    @interface EnumGuiOptions {
 
         DisplayType displayType() default DisplayType.BUTTON;
 

+ 3 - 3
src/main/java/me/lortseam/completeconfig/collection/EntryMap.java

@@ -117,12 +117,12 @@ public class EntryMap extends ConfigMap<Entry> {
                     entry.setBounds(bounds.min(), bounds.max(), false);
                 }
                 if (Enum.class.isAssignableFrom(field.getType())) {
-                    if (field.isAnnotationPresent(ConfigEntry.EnumOptions.class)) {
-                        entry.setEnumOptions(field.getDeclaredAnnotation(ConfigEntry.EnumOptions.class).displayType());
+                    if (field.isAnnotationPresent(ConfigEntry.EnumGuiOptions.class)) {
+                        entry.setEnumOptions(field.getDeclaredAnnotation(ConfigEntry.EnumGuiOptions.class).displayType());
                     } else {
                         entry.setEnumOptions(EnumOptions.DisplayType.getDefault());
                     }
-                } else if (field.isAnnotationPresent(ConfigEntry.EnumOptions.class)) {
+                } else if (field.isAnnotationPresent(ConfigEntry.EnumGuiOptions.class)) {
                     throw new IllegalAnnotationTargetException("Cannot apply enum options to non enum field " + field);
                 }
                 clazzEntries.put(field.getName(), entry);

+ 1 - 1
src/main/java/me/lortseam/completeconfig/entry/EnumOptions.java

@@ -28,7 +28,7 @@ public class EnumOptions {
 
         static {
             try {
-                defaultValue = (DisplayType) ConfigEntry.EnumOptions.class.getDeclaredMethod("displayType").getDefaultValue();
+                defaultValue = (DisplayType) ConfigEntry.EnumGuiOptions.class.getDeclaredMethod("displayType").getDefaultValue();
             } catch (NoSuchMethodException e) {
                 throw new RuntimeException(e);
             }