Make the mod work on both forge & neoforge
Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
fcba61b050
commit
0726b36418
@ -56,8 +56,9 @@ object Configuration {
|
||||
getMethod("getConfigDir").invoke(getMethod("getInstance").invoke(null))
|
||||
}
|
||||
} else {
|
||||
Class.forName("net.neoforged.fml.loading.FMLPaths")
|
||||
.getField("CONFIGDIR")
|
||||
try { Class.forName("net.neoforged.fml.loading.FMLPaths") } catch (_: ClassNotFoundException) {
|
||||
Class.forName("net.minecraftforge.fml.loading.FMLPaths")
|
||||
}.getField("CONFIGDIR")
|
||||
.get(null)
|
||||
.let { enum ->
|
||||
enum.javaClass.getMethod("get").invoke(enum)
|
||||
|
Loading…
Reference in New Issue
Block a user