-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathbuild.gradle.kts
287 lines (244 loc) · 10.1 KB
/
build.gradle.kts
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
plugins {
id("java")
id("com.gradleup.shadow") version "8.3.2"
id("xyz.jpenilla.run-paper") version "2.3.1"
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
}
group = "com.hibiscusmc"
version = "2.7.5${getGitCommitHash()}"
allprojects {
apply(plugin = "java")
apply(plugin = "java-library")
repositories {
mavenCentral()
// Paper Repo
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
// Jitpack
maven("https://jitpack.io")
// ProtocolLib repo
maven("https://repo.dmulloy2.net/repository/public/") //ProtocolLib Repo, constantly down
maven("https://repo.mineinabyss.com/releases/")
maven("https://repo.mineinabyss.com/snapshots/")
// PlaceholderAPI
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
// Citizens & Denizen
maven("https://maven.citizensnpcs.co/repo")
// Worldguard
maven("https://maven.enginehub.org/repo/")
// Backup Oraxen repo
maven("https://repo.skyslycer.de/")
// MythicMobs
maven {
url = uri("https://mvn.lumine.io/repository/maven-public")
metadataSources {
artifact()
}
}
// ParticleHelper
maven("https://repo.bytecode.space/repository/maven-public/")
// PlayerAnimator
maven("https://mvn.lumine.io/repository/maven/")
// md-5 Repo
maven("https://repo.md-5.net/content/groups/public/")
// MMOItems
maven("https://nexus.phoenixdevt.fr/repository/maven-public/")
// Eco-Suite/Auxilor Repo
maven("https://repo.auxilor.io/repository/maven-public/")
// Triumph GUI
maven("https://repo.triumphteam.dev/snapshots")
// Hibiscus Commons
maven("https://repo.hibiscusmc.com/releases")
}
dependencies {
compileOnly(fileTree("${project.rootDir}/lib") { include("*.jar") })
compileOnly("com.mojang:authlib:1.5.25")
//compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.jetbrains:annotations:24.1.0")
compileOnly("com.comphenix.protocol:ProtocolLib:5.3.0")
compileOnly("me.clip:placeholderapi:2.11.6")
compileOnly("com.ticxo.modelengine:ModelEngine:R4.0.6")
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.12")
//compileOnly("it.unimi.dsi:fastutil:8.5.14")
compileOnly("org.projectlombok:lombok:1.18.34")
compileOnly("me.lojosho:HibiscusCommons:0.6.0-85d65299")
// Handled by Spigot Library Loader
compileOnly("net.kyori:adventure-api:4.18.0")
compileOnly("net.kyori:adventure-text-minimessage:4.18.0")
compileOnly("net.kyori:adventure-platform-bukkit:4.3.4")
annotationProcessor("org.projectlombok:lombok:1.18.36")
testCompileOnly("org.projectlombok:lombok:1.18.36")
testAnnotationProcessor("org.projectlombok:lombok:1.18.36")
implementation("dev.triumphteam:triumph-gui:3.1.12-SNAPSHOT") {
exclude("net.kyori") // Already have adventure API
}
implementation("com.owen1212055:particlehelper:1.0.0-SNAPSHOT")
implementation("com.ticxo.playeranimator:PlayerAnimator:R1.2.7")
}
}
dependencies {
implementation(project(path = ":common"))
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filteringCharset = Charsets.UTF_8.name()
}
runServer {
minecraftVersion("1.21.4")
downloadPlugins {
hangar("PlaceholderAPI", "2.11.6")
url("https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/build/libs/ProtocolLib.jar")
url("https://download.luckperms.net/1567/bukkit/loader/LuckPerms-Bukkit-5.4.150.jar")
}
}
shadowJar {
mergeServiceFiles()
relocate("dev.triumphteam.gui", "com.hibiscusmc.hmccosmetics.shaded.gui")
relocate("com.owen1212055.particlehelper", "com.hibiscusmc.hmccosmetics.shaded.particlehelper")
relocate("com.ticxo.playeranimator", "com.hibiscusmc.hmccosmetics.shaded.playeranimator")
archiveFileName.set("HMCCosmeticsRemapped-${project.version}.jar")
dependencies {
exclude(dependency("org.yaml:snakeyaml"))
}
doLast {
archiveFile.get().asFile.copyTo(layout.projectDirectory.file("run/plugins/HMCCosmeticsRemapped.jar").asFile, true)
println("If you use the plugin, consider buying it for: ")
println("The custom resource pack, Oraxen + ItemAdder configurations, and Discord support!")
println("Polymart: https://polymart.org/resource/1879")
println("Spigot: https://www.spigotmc.org/resources/100107/")
}
}
build {
dependsOn(shadowJar)
}
}
bukkit {
load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD
main = "com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin"
apiVersion = "1.20"
authors = listOf("LoJoSho")
depend = listOf("HibiscusCommons", "ProtocolLib")
softDepend = listOf("ModelEngine", "Oraxen", "ItemsAdder", "Geary", "HMCColor", "WorldGuard", "MythicMobs", "PlaceholderAPI", "SuperVanish", "PremiumVanish", "LibsDisguises", "Denizen", "MMOItems", "Eco")
version = "${project.version}"
loadBefore = listOf(
"Cosmin" // Fixes an issue with Cosmin loading before and taking /cosmetic, when messing with what we do.
)
commands {
register("cosmetic") {
description = "Base Cosmetic Command"
aliases = listOf("hmccosmetics", "cosmetics")
}
}
permissions {
register("hmccosmetics.cmd.default") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.cmd.apply") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.cmd.unapply") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.cmd.dye") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.cmd.wardrobe") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.cmd.menu") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.emote.shiftrun") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.cmd.emote") {
default = BukkitPluginDescription.Permission.Default.TRUE
}
register("hmccosmetics.cmd.playemote") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.playemote.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.emote.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.setwardrobesetting") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.dataclear") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.reload") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.apply.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.unapply.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.hide") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.show") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.hide.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.show.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.wardrobe.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.menu.other") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.debug") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.unapplydeath.bypass") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.disableall") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.hiddenreasons") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("hmccosmetics.cmd.clearhiddenreasons") {
default = BukkitPluginDescription.Permission.Default.OP
}
}
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
fun getGitCommitHash(): String {
var includeHash = true
val includeHashVariable = System.getenv("HMCC_INCLUDE_HASH")
if (!includeHashVariable.isNullOrEmpty()) includeHash = includeHashVariable.toBoolean()
if (includeHash) {
return try {
val process = ProcessBuilder("git", "rev-parse", "--short", "HEAD")
.redirectErrorStream(true)
.start()
process.inputStream.bufferedReader().use { "-" + it.readLine().trim() }
} catch (e: Exception) {
"-unknown" // Fallback if Git is not available or an error occurs
}
}
return ""
}