-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (110 loc) · 3.07 KB
/
build.gradle
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
buildscript {
repositories {
mavenLocal()
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:5+'
classpath "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.1.3"
}
}
import net.minecraftforge.forge.tasks.*
import org.jetbrains.gradle.ext.*
apply plugin: 'eclipse'
apply plugin: 'net.minecraftforge.gradle.patcher'
apply plugin: "org.jetbrains.gradle.plugin.idea-ext"
println(' Java: ' + System.getProperty('java.version') +
' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ')' +
' Arch: ' + System.getProperty('os.arch'))
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
configurations {
shade
compile.extendsFrom shade
}
group = 'me.yourname'
version = '1.0.0'
ext {
minecraft_version = '1.19.2'
mcp_version = '20220805.130853'
mappings_channel = 'official'
mappings_version = '1.19.2'
spi_version = '6.0.0'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'net.minecraftforge:forgespi:' + spi_version
// Use the shade to add the lib to the jar
// or use compile if you want to load the lib from the version.json
// from a maven repo
// shade 'package-here'
// compile 'package-here'
}
project(':mcp') {
apply plugin: 'net.minecraftforge.gradle.mcp'
mcp {
config = minecraft_version + '-' + mcp_version
pipeline = 'joined'
}
}
evaluationDependsOn(':mcp')
patcher {
parent = project(':mcp')
patchedSrc = file('src/main/java')
mappings channel: mappings_channel, version: mappings_version
mcVersion = minecraft_version
}
jar {
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
}
task runclient(type: JavaExec) {
group = "MCP"
description = "Runs the client"
classpath sourceSets.main.runtimeClasspath
if (System.getProperty("os.name").toLowerCase().contains("mac")) {
jvmArgs '-XstartOnFirstThread'
}
args '--gameDir', '.'
args '--version', minecraft_version
args '--assetsDir', downloadAssets.output
args '--assetIndex', "1.19"
args '--accessToken', '0'
main 'net.minecraft.client.main.Main'
workingDir 'run'
}
task setup() {
group = "MCP"
description = "Setups the dev workspace"
dependsOn ':extractMapped'
mkdir 'run/assets'
copy {
from downloadAssets.output.path
into 'run/assets'
}
}
task copyAssets {
group = "MCP"
description = "Download and place the assets into the run folder"
dependsOn ':downloadAssets'
mkdir 'run/assets'
copy {
from downloadAssets.output.path
into 'run/assets'
}
}
idea.project.settings {
runConfigurations {
"Minecraft"(Application) {
mainClass = 'mcp.client.Start'
workingDirectory = "$projectDir/run"
moduleName = idea.module.name + '.main'
}
}
}