Skip to content

Commit

Permalink
Revert "MCEF now verifies existing installation"
Browse files Browse the repository at this point in the history
This reverts commit b72ca24.
  • Loading branch information
1zun4 committed Dec 26, 2023
1 parent b72ca24 commit cb55077
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ dependencies {
exclude group: 'org.slf4j', module: 'slf4j-api'
exclude group: 'com.mojang', module: 'authlib'
}
implementation "com.github.CCBlueX:mcef:1.0.6-1.20.4"
implementation "com.github.CCBlueX:mcef:1.0.3-1.20.4"

implementation 'org.graalvm.sdk:graal-sdk:23.0.2'
implementation 'org.graalvm.truffle:truffle-api:23.0.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ class BrowserDrawer(val browser: () -> IBrowser?) : Listenable {
get() = browser()?.getTabs() ?: emptyList()

val preRenderHandler = handler<GameRenderEvent> {
browser()?.drawGlobally()
if (MCEF.isInitialized()) {
MCEF.getApp().handle.N_DoMessageLoopWork()
}

for (tab in tabs) {
tab.drawn = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,4 @@ interface IBrowser {

fun getBrowserType(): BrowserType

fun drawGlobally()

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import net.ccbluex.liquidbounce.config.ConfigSystem
import net.ccbluex.liquidbounce.event.Listenable
import net.ccbluex.liquidbounce.mcef.MCEF
import net.ccbluex.liquidbounce.mcef.MCEFDownloader
import net.ccbluex.liquidbounce.utils.client.logger
import net.ccbluex.liquidbounce.utils.io.HttpClient
import net.ccbluex.liquidbounce.web.browser.BrowserType
import net.ccbluex.liquidbounce.web.browser.supports.tab.JcefTab
Expand Down Expand Up @@ -52,10 +51,8 @@ class JcefBrowser : IBrowser, Listenable {
// Uses a natural user agent to prevent websites from blocking the browser
userAgent = HttpClient.DEFAULT_AGENT
}

// todo: add progression bar for downloading
val downloader = MCEFDownloader.newDownloader()
downloader.downloadJcef(librariesFolder)
MCEFDownloader.downloadJcef(librariesFolder)
}
}

Expand Down Expand Up @@ -90,14 +87,5 @@ class JcefBrowser : IBrowser, Listenable {
}

override fun getBrowserType() = BrowserType.JCEF
override fun drawGlobally() {
if (MCEF.isInitialized()) {
try {
MCEF.getApp().handle.N_DoMessageLoopWork()
} catch (e: Exception) {
logger.error("Failed to draw browser globally", e)
}
}
}

}

0 comments on commit cb55077

Please sign in to comment.