-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
95 lines (77 loc) · 2.82 KB
/
build.gradle
File metadata and controls
95 lines (77 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.vineflower:vineflower:1.11.2'
}
}
plugins {
id 'java'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.3'
id 'maven-publish'
id 'net.saliman.properties' version '1.6.0'
}
group = 'one.armelin'
version = '1.0.2'
def decomp(fileCollection) {
def jarFile = fileCollection.singleFile
if (jarFile.name.endsWith('.jar') && jarFile.exists()) {
def decompiled = new File(jarFile.parentFile, jarFile.name.replace('.jar', '-sources.jar'))
if (!decompiled.exists()) {
println "Decompiling ${jarFile.name}..."
def vineflowerJar = buildscript.configurations.classpath.find { it.name.contains('vineflower') }
println "Vineflower JAR: ${vineflowerJar}"
println "Input: ${jarFile.absolutePath}"
println "Output: ${decompiled.absolutePath}"
def process = new ProcessBuilder(
'java',
'-Xmx10G',
'-cp',
vineflowerJar.absolutePath,
'org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler',
jarFile.absolutePath,
decompiled.absolutePath
)
process.redirectErrorStream(true)
def proc = process.start()
proc.inputStream.eachLine { line ->
println " [Vineflower] ${line}"
}
def exitCode = proc.waitFor()
println "Exit code: ${exitCode}"
println "Decompiled JAR exists: ${decompiled.exists()}"
}
return files(jarFile)
}
return fileCollection
}
java {
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
repositories {
mavenCentral()
}
dependencies {
implementation decomp(files("${project.HytaleInstallDir}/install/release/package/game/latest/Server/HytaleServer.jar"))
}
def serverRunDir = file("$projectDir/run/server")
if (!serverRunDir.exists()) {
serverRunDir.mkdirs()
}
idea.project.settings.runConfigurations {
'HytaleServer'(org.jetbrains.gradle.ext.Application) {
mainClass = 'com.hypixel.hytale.Main'
moduleName = project.idea.module.name + '.main'
programParameters = "--allow-op --assets=${project.HytaleInstallDir}/install/release/package/game/latest/Assets.zip"
if (includes_pack.toBoolean()) {
programParameters += " --mods=${sourceSets.main.java.srcDirs.first().parentFile.absolutePath}"
}
if (load_user_mods.toBoolean()) {
programParameters += " --mods=${project.HytaleInstallDir}/UserData/Mods"
}
//workingDirectory = serverRunDir.absolutePath
workingDirectory = file("${project.ServerDir}").absolutePath
}
}