diff options
author | mdxd44 <ogurec332@mail.ru> | 2021-12-23 12:15:10 +0900 |
---|---|---|
committer | mdxd44 <ogurec332@mail.ru> | 2021-12-23 12:15:10 +0900 |
commit | 5fe79b92327c082384068fa45c3b1d2691800e3d (patch) | |
tree | ae8ab7382d969baa807da7d94c2a81bff8ba0405 /src/main/java/net/elytrium/limboauth/config | |
parent | cff1b4a22bb47c8bcf064d5e8da8c7d7ef67ea52 (diff) | |
download | LimboAuth-5fe79b92327c082384068fa45c3b1d2691800e3d.tar.gz LimboAuth-5fe79b92327c082384068fa45c3b1d2691800e3d.tar.bz2 LimboAuth-5fe79b92327c082384068fa45c3b1d2691800e3d.zip |
Titles, auth time, bossbar, max and min auth time, unsafe passwords. (Closes LimboAPI#8)
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/config')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/config/Config.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/net/elytrium/limboauth/config/Config.java b/src/main/java/net/elytrium/limboauth/config/Config.java index ed5b007..1cb9803 100644 --- a/src/main/java/net/elytrium/limboauth/config/Config.java +++ b/src/main/java/net/elytrium/limboauth/config/Config.java @@ -208,7 +208,7 @@ public class Config { } } - private void save(PrintWriter writer, Class<?> clazz, final Object instance, int indent) { + private void save(PrintWriter writer, Class<?> clazz, Object instance, int indent) { try { String lineSeparator = System.lineSeparator(); String spacing = this.repeat(" ", indent); @@ -356,9 +356,14 @@ public class Config { private void setAccessible(Field field) throws NoSuchFieldException, IllegalAccessException { field.setAccessible(true); if (Modifier.isFinal(field.getModifiers())) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + if (Runtime.version().feature() < 12) { + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + } else { + // TODO: Maybe use sun.misc.Unsafe?... + throw new UnsupportedOperationException(); + } } } @@ -377,7 +382,7 @@ public class Config { return array[0].toString(); } default: { - final StringBuilder result = new StringBuilder(); + StringBuilder result = new StringBuilder(); for (int i = 0, j = array.length; i < j; ++i) { if (i > 0) { result.append(delimiter); |