2024-11-16 18:10:57 +01:00
|
|
|
import io.papermc.paperweight.userdev.ReobfArtifactConfiguration
|
|
|
|
import io.papermc.paperweight.util.path
|
|
|
|
import xyz.jpenilla.runtask.RunExtension
|
|
|
|
|
2023-12-11 12:00:33 +01:00
|
|
|
plugins {
|
|
|
|
id("java")
|
2024-09-29 17:35:09 +02:00
|
|
|
id("com.gradleup.shadow") version "8.3.2"
|
2024-06-07 22:38:57 +02:00
|
|
|
id("xyz.jpenilla.run-paper") version "2.3.0"
|
2024-10-31 20:05:22 +01:00
|
|
|
id("io.papermc.paperweight.userdev") version "1.7.4"
|
2023-12-11 12:00:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
group = "xyz.ineanto"
|
2024-09-29 17:35:09 +02:00
|
|
|
version = "1.2.0"
|
2023-12-11 12:00:33 +01:00
|
|
|
|
2023-12-11 13:21:30 +01:00
|
|
|
java {
|
2024-05-16 21:09:56 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
|
|
targetCompatibility = JavaVersion.VERSION_21
|
2023-12-11 13:21:30 +01:00
|
|
|
toolchain {
|
2024-05-16 21:09:56 +02:00
|
|
|
languageVersion = JavaLanguageVersion.of(21)
|
2023-12-11 13:21:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-11 12:00:33 +01:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
2024-06-14 22:47:11 +02:00
|
|
|
maven { url = uri("https://jitpack.io") }
|
2023-12-11 12:00:33 +01:00
|
|
|
maven {
|
|
|
|
name = "xenondevs"
|
|
|
|
url = uri("https://repo.xenondevs.xyz/releases")
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "papermc"
|
|
|
|
url = uri("https://repo.papermc.io/repository/maven-public/")
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "codemc"
|
|
|
|
url = uri("https://repo.codemc.io/repository/maven-snapshots/")
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "placeholderapi"
|
|
|
|
url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-10-31 20:05:22 +01:00
|
|
|
paperweight.paperDevBundle("1.21.3-R0.1-SNAPSHOT")
|
|
|
|
|
2024-10-31 17:52:30 +01:00
|
|
|
compileOnly("com.github.dmulloy2:ProtocolLib:5.3.0")
|
2024-05-16 21:09:56 +02:00
|
|
|
compileOnly("me.clip:placeholderapi:2.11.5")
|
2024-06-07 22:38:57 +02:00
|
|
|
compileOnly("net.kyori:adventure-api:4.17.0")
|
2023-12-11 12:00:33 +01:00
|
|
|
|
2024-11-16 18:10:57 +01:00
|
|
|
implementation("xyz.xenondevs.invui:invui-core:1.41")
|
|
|
|
implementation("xyz.xenondevs.invui:inventory-access-r21:1.41")
|
|
|
|
|
|
|
|
implementation("net.wesjd:anvilgui:1.10.3-SNAPSHOT")
|
2024-05-16 21:09:56 +02:00
|
|
|
implementation("com.github.jsixface:yamlconfig:1.2")
|
2024-10-31 20:35:58 +01:00
|
|
|
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.1")
|
|
|
|
implementation("com.fasterxml.jackson.core:jackson-core:2.18.1")
|
2024-11-16 18:10:57 +01:00
|
|
|
implementation("com.mysql:mysql-connector-j:9.1.0")
|
|
|
|
implementation("org.mariadb.jdbc:mariadb-java-client:3.5.0")
|
|
|
|
implementation("redis.clients:jedis:5.2.0")
|
2024-05-16 21:09:56 +02:00
|
|
|
implementation("com.google.code.gson:gson:2.10.1")
|
2023-12-11 12:00:33 +01:00
|
|
|
|
2024-10-31 17:52:30 +01:00
|
|
|
testImplementation("com.github.MockBukkit:MockBukkit:v3.133.2")
|
2024-05-04 14:26:32 +02:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.2")
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
2023-12-11 12:00:33 +01:00
|
|
|
}
|
|
|
|
|
2024-11-16 18:10:57 +01:00
|
|
|
paperweight {
|
|
|
|
reobfArtifactConfiguration = ReobfArtifactConfiguration.REOBF_PRODUCTION
|
|
|
|
}
|
|
|
|
|
2023-12-19 14:31:15 +01:00
|
|
|
tasks {
|
2024-11-16 18:10:57 +01:00
|
|
|
|
2023-12-19 14:31:15 +01:00
|
|
|
processResources {
|
|
|
|
from("src/main/resources")
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
2023-12-23 00:02:49 +01:00
|
|
|
filesMatching("*.yml") {
|
2023-12-19 14:31:15 +01:00
|
|
|
expand("version" to version)
|
|
|
|
}
|
2023-12-11 12:00:33 +01:00
|
|
|
}
|
|
|
|
|
2023-12-19 14:31:15 +01:00
|
|
|
shadowJar {
|
2023-12-11 12:00:33 +01:00
|
|
|
// RELOCATIONS
|
|
|
|
relocate("xyz.xenondevs", "xyz.ineanto.nicko.libs.invui")
|
2023-12-11 12:31:16 +01:00
|
|
|
relocate("me.clip", "xyz.ineanto.nicko.libs.placeholderapi")
|
2023-12-11 12:00:33 +01:00
|
|
|
relocate("net.wesjd", "xyz.ineanto.nicko.libs.anvilgui")
|
|
|
|
relocate("com.github.jsixface", "xyz.ineanto.nicko.libs.yaml")
|
2024-10-31 20:35:58 +01:00
|
|
|
relocate("com.fasterxml.jackson", "xyz.ineanto.nicko.libs.jacksonpr")
|
2023-12-11 12:00:33 +01:00
|
|
|
relocate("com.mysql", "xyz.ineanto.nicko.libs.mysql")
|
|
|
|
relocate("org.mariadb.jdbc", "xyz.ineanto.nicko.libs.mariadb")
|
|
|
|
relocate("redis.clients", "xyz.ineanto.nicko.libs.redis")
|
2023-12-11 12:31:16 +01:00
|
|
|
relocate("com.google.gson", "xyz.ineanto.nicko.libs.gson")
|
2023-12-11 12:00:33 +01:00
|
|
|
relocate("org.apache.commons.pool2", "xyz.ineanto.nicko.libs.pool2")
|
2023-12-11 13:02:32 +01:00
|
|
|
relocate("org.bstats", "xyz.ineanto.nicko.libs.bstats")
|
2023-12-11 12:00:33 +01:00
|
|
|
|
2023-12-11 12:31:44 +01:00
|
|
|
// EXCLUSIONS
|
2023-12-11 12:31:16 +01:00
|
|
|
exclude("colors.bin")
|
|
|
|
exclude("waffle/**")
|
|
|
|
exclude("com/sun/**")
|
|
|
|
exclude("com/google/protobuf/**")
|
|
|
|
exclude("com/google/errorprone/**")
|
|
|
|
exclude("org/apache/commons/logging/**")
|
|
|
|
exclude("org/jetbrains/**")
|
|
|
|
exclude("org/intellij/**")
|
|
|
|
exclude("org/checkerframework/**")
|
|
|
|
exclude("org/json/**")
|
|
|
|
exclude("org/slf4j/**")
|
|
|
|
exclude("org/yaml/**")
|
|
|
|
exclude("google/protobuf/**")
|
|
|
|
exclude("net/kyori/**")
|
2023-12-11 12:31:44 +01:00
|
|
|
|
|
|
|
// MINIFY
|
|
|
|
minimize {
|
|
|
|
exclude(dependency("xyz.xenondevs.invui:.*"))
|
|
|
|
exclude(dependency("net.wesjd:.*"))
|
2023-12-21 00:16:19 +01:00
|
|
|
exclude(dependency("org.bstats:.*"))
|
2023-12-11 12:31:44 +01:00
|
|
|
}
|
2024-11-16 18:10:57 +01:00
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes["paperweight-mappings-namespace"] = "spigot"
|
|
|
|
}
|
2023-12-11 12:00:33 +01:00
|
|
|
}
|
2023-12-19 14:31:15 +01:00
|
|
|
|
|
|
|
runServer {
|
2024-11-16 18:10:57 +01:00
|
|
|
dependsOn(reobfJar)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* https://github.com/jpenilla/run-task/issues/56
|
|
|
|
*
|
|
|
|
* jpenilla:
|
|
|
|
* "On 1.20.5+ it makes no sense to waste time obfuscating the jar in development
|
|
|
|
* just for it to be immediately deobfuscated.
|
|
|
|
* If you have an edge case setup where this makes sense somehow,
|
|
|
|
* you can disable plugin jar detection and configure the plugin jars collection yourself."
|
|
|
|
*
|
|
|
|
* Well, Nicko is an edge case.
|
|
|
|
* AnvilGUI and InvUI are still using Spigot Mappings,
|
|
|
|
* and I'm stuck using them until they push a major, breaking update.
|
|
|
|
*/
|
|
|
|
args("-add-plugin=${reobfJar.get().outputJar.path.toAbsolutePath()}")
|
2023-12-28 21:02:09 +01:00
|
|
|
|
2023-12-19 14:31:15 +01:00
|
|
|
downloadPlugins {
|
2024-08-13 18:24:53 +02:00
|
|
|
url("https://download.luckperms.net/1554/bukkit/loader/LuckPerms-Bukkit-5.4.139.jar")
|
2024-08-26 22:39:04 +02:00
|
|
|
|
|
|
|
// 1.20 - 1.20.4 testing
|
2024-08-27 22:48:39 +02:00
|
|
|
//url("https://github.com/dmulloy2/ProtocolLib/releases/download/5.2.0/ProtocolLib.jar")
|
2024-08-26 22:39:04 +02:00
|
|
|
|
|
|
|
// 1.20.5 - latest testing
|
2024-08-27 22:48:39 +02:00
|
|
|
url("https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/build/libs/ProtocolLib.jar")
|
2023-12-19 14:31:15 +01:00
|
|
|
}
|
2023-12-11 12:00:33 +01:00
|
|
|
|
2024-10-31 20:35:58 +01:00
|
|
|
minecraftVersion("1.21.3")
|
2023-12-21 17:40:57 +01:00
|
|
|
}
|
2024-11-16 18:10:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
extensions.configure<RunExtension> {
|
|
|
|
disablePluginJarDetection()
|
2023-12-22 14:57:24 +01:00
|
|
|
}
|