2024-08-05 13:12:51 +02:00
|
|
|
// Code copied from https://github.com/Shopkeepers/Shopkeepers/tree/master
|
|
|
|
|
|
|
|
apply plugin: 'java-library'
|
|
|
|
|
|
|
|
apply from: rootProject.file('nms/specialSource.gradle')
|
|
|
|
|
|
|
|
ext {
|
|
|
|
// This needs to be defined by projects that apply this script.
|
|
|
|
craftbukkitVersion = 'UNSPECIFIED'
|
|
|
|
// This can be overridden by projects that apply this script.
|
|
|
|
remapServerCode = true
|
|
|
|
}
|
|
|
|
|
2024-11-12 02:17:14 +01:00
|
|
|
afterEvaluate {
|
|
|
|
dependencies {
|
|
|
|
implementation project(':shared')
|
|
|
|
compileOnly libs.io.netty.netty.buffer
|
|
|
|
compileOnly libs.it.unimi.dsi.fastutil
|
|
|
|
compileOnly libs.com.mojang.datafixerupper
|
|
|
|
|
2024-08-05 13:12:51 +02:00
|
|
|
if (remapServerCode) {
|
|
|
|
implementation "org.spigotmc:spigot:${craftbukkitVersion}:remapped-mojang"
|
|
|
|
} else {
|
|
|
|
implementation "org.spigotmc:spigot:${craftbukkitVersion}"
|
|
|
|
}
|
|
|
|
}
|
2024-11-12 02:24:48 +01:00
|
|
|
|
|
|
|
configurations.compileClasspath.resolve()
|
2024-08-05 13:12:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
if (remapServerCode) {
|
|
|
|
jar {
|
|
|
|
doLast {
|
|
|
|
def outputFiles = outputs.files.files
|
|
|
|
for (inputFile in outputFiles) {
|
|
|
|
File intermediateFile = new File(temporaryDir, inputFile.name.replace('.jar', '-obf.jar'))
|
|
|
|
File outputFile = inputFile
|
|
|
|
remapMojangToSpigot(inputFile, intermediateFile, outputFile, craftbukkitVersion)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Note: The NMS modules are not published as standalone artifacts, but are shaded into the final plugin jar.
|