From a086a98cff6d5b327477fe7846495f1d392feebd Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Mon, 23 May 2022 18:05:14 +0200 Subject: OC-23 some things --- .../oneconfig/config/compatibility/VigilanceConfig.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/config/compatibility') diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java index a5ac1f6..f31b609 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java @@ -130,25 +130,28 @@ public class VigilanceConfig extends Config { private String getName(PropertyAttributesExt ext) { try { + PropertyAttributesExt.class.getDeclaredField("i18nName").setAccessible(true); return I18n.format((String) PropertyAttributesExt.class.getDeclaredField("i18nName").get(ext)); } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); + return ext.getName(); } } private String getCategory(PropertyAttributesExt ext) { try { + PropertyAttributesExt.class.getDeclaredField("i18nCategory").setAccessible(true); return I18n.format((String) PropertyAttributesExt.class.getDeclaredField("i18nCategory").get(ext)); } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); + return ext.getCategory(); } } private String getSubcategory(PropertyAttributesExt ext) { try { + PropertyAttributesExt.class.getDeclaredField("i18nSubcategory").setAccessible(true); return I18n.format((String) PropertyAttributesExt.class.getDeclaredField("i18nSubcategory").get(ext)); } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); + return ext.getSubcategory(); } } -- cgit