@@ -149,7 +149,7 @@ project(':mohist') {
149
149
BINPATCH_TOOL = ' net.minecraftforge:binarypatcher:1.1.1:fatjar'
150
150
}
151
151
152
- version = ' 1.12.2-' + JenkinsNumber ()
152
+ version = ' 1.12.2-' + mohist_api ()
153
153
154
154
patcher {
155
155
exc = file(" $rootDir /src/main/resources/forge.exc" )
@@ -815,21 +815,18 @@ task setup() {
815
815
dependsOn ' :mohist:extractMapped' // These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
816
816
}
817
817
818
- static def JenkinsNumber () {
819
- return 344
820
- /*
818
+ static def mohist_api () {
821
819
try {
822
- def conn = new URL("https://ci.codemc.io/job/MohistMC/job/Mohist-1.12.2/api/json").openConnection()
820
+ URL url = new URL (" https://mohistmc.com/api/v2/projects/mohist/1.12.2/builds/latest" )
821
+ HttpURLConnection conn = (HttpURLConnection ) url. openConnection()
823
822
conn. setRequestProperty(" User-Agent" , " Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0" )
824
823
conn. connect()
825
824
def root = conn. content. text
826
- def jsonSluper = new JsonSlurper()
825
+ def jsonSlurper = new JsonSlurper ()
826
+ def data = jsonSlurper. parseText(root)
827
827
828
- String data = jsonSluper.parseText(root)
829
- def number = data.substring(data.indexOf("number")).split(",")
830
- return Integer.valueOf(number[0].replace("number=", "")).intValue()
831
- } catch (Exception e1) {
828
+ return Integer . valueOf(data. build. number) + 1
829
+ } catch (Exception ignored) {
832
830
return ' dev'
833
831
}
834
- */
835
832
}
0 commit comments