-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
68 lines (55 loc) · 2.81 KB
/
build.gradle.kts
File metadata and controls
68 lines (55 loc) · 2.81 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
@file:Suppress("UnstableApiUsage", "PropertyName")
import dev.deftu.gradle.utils.GameSide
plugins {
java
kotlin("jvm")
id("dev.deftu.gradle.multiversion") // Applies preprocessing for multiple versions of Minecraft and/or multiple mod loaders.
id("dev.deftu.gradle.tools") // Applies several configurations to things such as the Java version, project name/version, etc.
id("dev.deftu.gradle.tools.resources") // Applies resource processing so that we can replace tokens, such as our mod name/version, in our resources.
id("dev.deftu.gradle.tools.bloom") // Applies the Bloom plugin, which allows us to replace tokens in our source files, such as being able to use `@MOD_VERSION` in our source files.
id("dev.deftu.gradle.tools.shadow") // Applies the Shadow plugin, which allows us to shade our dependencies into our mod JAR. This is NOT recommended for Fabric mods, but we have an *additional* configuration for those!
id("dev.deftu.gradle.tools.ducks") // Creates a ducks source set, which allows us to use theoretical classes which may not exist at runtime (such as things which are in other mods).
id("dev.deftu.gradle.tools.minecraft.loom") // Applies the Loom plugin, which automagically configures Essential's Architectury Loom plugin for you.
id("dev.deftu.gradle.tools.minecraft.releases") // Applies the Minecraft auto-releasing plugin, which allows you to automatically release your mod to CurseForge and Modrinth.
}
toolkitLoomHelper {
useOneConfig {
version = "1.0.0-alpha.168"
loaderVersion = "1.1.0-alpha.49"
usePolyMixin = true
polyMixinVersion = "0.8.4+build.7"
applyLoaderTweaker = true
for (module in arrayOf("commands", "config", "config-impl", "events", "internal", "ui", "utils")) {
+module
}
}
useMixinExtras("0.5.0") //todo hopefully remove when oneconfig updates?
// Turns off the server-side run configs, as we're building a client-sided mod.
disableRunConfigs(GameSide.SERVER)
// Defines the name of the Mixin refmap, which is used to map the Mixin classes to the obfuscated Minecraft classes.
if (!mcData.isNeoForge) {
useMixinRefMap("hytils")
}
if (mcData.isForge) {
// Configures the Mixin tweaker if we are building for Forge.
useForgeMixin("hytils")
}
}
loom {
if (mcData.isLegacyForge) {
forge {
accessTransformer(rootProject.file("src/main/resources/hytils_at.cfg"))
}
} else if (mcData.isLegacyFabric) {
accessWidenerPath.set(rootProject.file("src/main/resources/hytils_aw.accesswidener"))
}
}
dependencies {
implementation(shade("com.github.ben-manes.caffeine:caffeine:2.9.3")!!)
compileOnly("com.mojang:datafixerupper:4.0.26")
}
tasks {
processResources {
exclude("hytils_at.cfg")
}
}