forked from MLG-Fortress/AutomaticInventory
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
137 lines (126 loc) · 5.02 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
import xyz.jpenilla.resourcefactory.bukkit.BukkitPluginYaml
import xyz.jpenilla.resourcefactory.bukkit.Permission
//import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import java.net.URI
plugins {
`java-library`
// Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev
id("io.papermc.paperweight.userdev") version "1.7.1"
// Adds runServer and runMojangMappedServer tasks for testing
id("xyz.jpenilla.run-paper") version "2.3.0"
// Generates plugin.yml based on the Gradle config
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.1.1"
// id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "dev.chaws.automaticinventory"
version = "4.0.0"
description = "Automatic Inventory PaperMC Plugin"
repositories {
mavenLocal()
mavenCentral()
maven {
name = "papermc"
url = URI("https://repo.papermc.io/repository/maven-public/")
}
maven {
name = "spigotmc"
url = URI("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
maven {
name = "bstats"
url = URI("https://oss.sonatype.org/content/groups/public/")
}
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
dependencies {
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
// paperweight.foliaDevBundle("1.21-R0.1-SNAPSHOT")
// paperweight.devBundle("com.example.paperfork", "1.21-R0.1-SNAPSHOT")
implementation("org.bstats:bstats-bukkit:3.0.2")
// Add ASM dependency to support Java 21 class files
implementation("org.ow2.asm:asm:9.7")
implementation("org.ow2.asm:asm-commons:9.7")
}
// Option 1)
// For >=1.20.5 when you don"t care about supporting spigot
// paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
// Option 2)
// For 1.20.4 or below, or when you care about supporting Spigot on >=1.20.5
// Configure reobfJar to run when invoking the build task
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION
tasks {
assemble {
// dependsOn(shadowJar)
dependsOn(reobfJar)
}
// named<ShadowJar>("shadowJar") {
//
// relocate("org.bstats", "dev.chaws.automaticinventory.org.bstats")
// }
}
bukkitPluginYaml {
main = "dev.chaws.automaticinventory.AutomaticInventory"
// TODO: Try POSTWORLD
load = BukkitPluginYaml.PluginLoadOrder.STARTUP
authors = listOf("Chaws", "Pugabyte", "AllTheCode", "RoboMWM", "Big_Scary")
apiVersion = "1.21"
commands.register("autosort") {
description = "Toggles auto-sorting options."
permission = "automaticinventory.sortchests"
usage = "/AutoSort"
}
commands.register("depositall") {
aliases = listOf("da", "dumpitems", "dumploot", "depositloot")
description = "Deposits your non-hotbar inventory into any nearby chests containing matching items."
permission = "automaticinventory.depositall"
usage = "/DepositAll"
}
commands.register("quickdeposit") {
description = "Toggles quick deposit (shift+left click on chests)."
permission = "automaticinventory.quickdeposit"
usage = "/quickdeposit"
}
commands.register("autorefill") {
description = "Toggles auto refill, which refills your hotbar slots when items are depleted or break."
permission = "automaticinventory.refillstacks"
usage = "/autorefill"
}
permissions.register("automaticinventory.admin.*") {
description = "Grants all administrative privileges."
children = mapOf(
"automaticinventory.user.*" to true
)
}
permissions.register("automaticinventory.user.*") {
description = "Grants all user privileges."
children = mapOf(
"automaticinventory.sortinventory" to true,
"automaticinventory.sortchests" to true,
"automaticinventory.refillstacks" to true,
"automaticinventory.quickdeposit" to true,
"automaticinventory.depositall" to true
)
}
permissions.register("automaticinventory.sortinventory") {
description = "Grants permission to auto-sort personal inventory."
default = Permission.Default.TRUE
}
permissions.register("automaticinventory.sortchests") {
description = "Grants permission to auto-sort chest content."
default = Permission.Default.TRUE
}
permissions.register("automaticinventory.refillstacks") {
description = "Grants permission to auto-refill depleted hotbar stacks."
default = Permission.Default.TRUE
}
permissions.register("automaticinventory.quickdeposit") {
description = "Grants permission to auto-deposit matching items into a chest with shift-right-click."
default = Permission.Default.TRUE
}
permissions.register("automaticinventory.depositall") {
description = "Grants permission to use /depositall."
default = Permission.Default.TRUE
}
}