From 735de8d0b78eb62b83ba68bce2809abfa74e67c4 Mon Sep 17 00:00:00 2001 From: Username404 Date: Fri, 16 Jul 2021 15:22:29 +0200 Subject: [PATCH] Fix the Ok Zoomer compatibility on newer versions --- .../main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt index fcf756f..df96082 100644 --- a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt +++ b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt @@ -52,10 +52,10 @@ private val okZoomerPairs by lazy { } catch (e: ClassNotFoundException) { with(Class.forName("io.github.ennuil.okzoomer.utils.ZoomUtils").getDeclaredField("zoomerZoom")) { get(null).javaClass.run { - (getField("zoomDivisor") to this@with) to (getField("zoom") to this@with) + (getDeclaredField("zoomDivisor") to this@with.get(null)) to (getDeclaredField("zoom") to this@with.get(null)) } } - } + }.apply { first.first.isAccessible = true; second.first.isAccessible = true; } } fun fabricZoom() {