diff --git a/build.gradle b/build.gradle index 04eb73f1e..ac9652d0a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1692122114 +//version: 1695323114 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -599,8 +599,11 @@ repositories { } } maven { - name = "ic2-mirror" - url = "https://maven2.ic2.player.to/" + name = "ic2" + url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/") + content { + includeGroup "net.industrial-craft" + } metadataSources { mavenPom() artifact() @@ -1568,6 +1571,25 @@ def getSecondaryArtifacts() { return secondaryArtifacts } +def getURL(String main, String fallback) { + return pingURL(main, 10000) ? main : fallback +} + +// credit: https://stackoverflow.com/a/3584332 +def pingURL(String url, int timeout) { + url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates. + try { + HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection() + connection.setConnectTimeout(timeout) + connection.setReadTimeout(timeout) + connection.setRequestMethod("HEAD") + int responseCode = connection.getResponseCode() + return 200 <= responseCode && responseCode <= 399 + } catch (IOException ignored) { + return false + } +} + // For easier scripting of things that require variables defined earlier in the buildscript if (file('addon.late.gradle.kts').exists()) { apply from: 'addon.late.gradle.kts' diff --git a/dependencies.gradle b/dependencies.gradle index 4a609bf87..2d355bcf2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.44.18:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.44.19:dev") api("com.github.GTNewHorizons:Yamcl:0.5.86:dev") api("com.github.GTNewHorizons:Baubles:1.0.1.16:dev") @@ -16,7 +16,7 @@ dependencies { compileOnly("com.github.GTNewHorizons:WitcheryExtras:1.1.14:dev") { transitive = false } compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false } compileOnly("curse.maven:witchery-69673:2234410") { transitive = false } - compileOnly("com.github.GTNewHorizons:GTplusplus:1.10.8:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:GTplusplus:1.10.9:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:Chisel:2.11.4-GTNH:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:Botania:1.10.0-GTNH:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:BloodMagic:1.4.3:dev") { transitive = false }