Skip to content

Commit 4479b85

Browse files
committed
Datagen achievements, textures, models
1 parent f4bf8e4 commit 4479b85

33 files changed

+108
-85
lines changed

build.gradle

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,23 @@ sourceSets {
3434
java {
3535
srcDir "src/api/java"
3636
}
37+
38+
resources.srcDirs = []
3739
compileClasspath += configurations.getByName("minecraft")
3840
}
3941

4042
main {
4143
java {
42-
srcDir "src/api/java"
4344
srcDir "src/main/java"
4445
}
4546

4647
resources {
4748
srcDir "src/main/resources"
48-
srcDir 'src/generated/resources'
49+
srcDir "src/generated/resources"
4950
}
51+
52+
compileClasspath += sourceSets.api.output
53+
runtimeClasspath += sourceSets.api.output
5054
}
5155
}
5256

@@ -77,6 +81,7 @@ minecraft {
7781
mods {
7882
compactmachines {
7983
source sourceSets.main
84+
source sourceSets.api
8085
}
8186
}
8287
}
@@ -96,6 +101,7 @@ minecraft {
96101
mods {
97102
compactmachines {
98103
source sourceSets.main
104+
source sourceSets.api
99105
}
100106
}
101107
}
@@ -120,53 +126,14 @@ minecraft {
120126
mods {
121127
compactmachines {
122128
source sourceSets.main
129+
source sourceSets.api
123130
}
124131
}
125132
}
126133
}
127134
}
128135

129-
def getModVersion(filename) {
130-
// println(filename);
131-
def pattern = /^(?<modid>[^-]+)(?:-(?<mcversion>[0-9.]+))?(?:-(?<modver>[0-9.\-]+))\.jar$/;
132-
133-
def matcher = filename =~ pattern
134-
135-
def found = matcher.find()
136-
137-
if (found) {
138-
def mod = matcher.group("modid");
139-
140-
// Extract MC version or default
141-
def mcVersion = matcher.group("mcversion");
142-
143-
// Extract mod version
144-
def version = matcher.group("modver");
145-
146-
// println("> mod: ${mod}; mc: ${mcVersion}; version: ${version}");
147-
148-
if (mcVersion == null)
149-
return "${mod}:${mod}:${version}";
150-
else
151-
return "${mod}:${mod}-${mcVersion}:${version}";
152-
153-
} else {
154-
println("> not a mod filename")
155-
return filename;
156-
}
157-
}
158-
159-
def dev_mods_dir = "mods"
160-
161-
task("dev") {
162-
println(sourceSets.main.output.classesDirs[0]);
163-
}
164136
repositories {
165-
// Built mods
166-
flatDir {
167-
dirs dev_mods_dir
168-
}
169-
170137
maven {
171138
url "https://www.cursemaven.com"
172139
content {
@@ -187,19 +154,12 @@ repositories {
187154
}
188155
}
189156

190-
def dev_mods = fileTree(dev_mods_dir).filter { it -> it.isFile() }.files.name.collect({ getModVersion(it) })
191-
192157
dependencies {
193158
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
194159
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
195160
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
196161
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
197162

198-
199-
// Deobfuscate each dev mod for runtime
200-
dev_mods.each { implementation(fg.deobf(it)) }
201-
202-
203163
// JEI
204164
compileOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}:api")
205165
runtimeOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}")
@@ -218,13 +178,17 @@ dependencies {
218178
// runtimeOnly(fg.deobf("curse.maven:mekanismgenerators-268566:3206395"))
219179
}
220180

221-
// Example for how to get properties into the manifest for reading by the runtime..
181+
processResources {
182+
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
183+
}
184+
222185
jar {
223-
from sourceSets.api.output
224186
from sourceSets.main.output
187+
from sourceSets.api.output
225188
destinationDirectory = file("$rootDir/build-out")
226189

227190
finalizedBy('reobfJar')
191+
228192
manifest {
229193
attributes([
230194
"Specification-Title" : "compactmachines",
@@ -245,14 +209,6 @@ task apiJar(type: Jar) {
245209
destinationDirectory = file("$rootDir/build-out")
246210
}
247211

248-
processApiResources {
249-
duplicatesStrategy = DuplicatesStrategy.WARN
250-
}
251-
252-
processResources {
253-
duplicatesStrategy = DuplicatesStrategy.WARN
254-
}
255-
256212
artifacts {
257213
archives jar, apiJar
258214
}

src/generated/resources/.cache/cache

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
1fedf6d545654e233de36085df4d0e8e771524ff assets/compactmachines/blockstates/machine_giant.json
2+
f8e983d75656fe6193baa1e7f0c205b8ed8c427f assets/compactmachines/blockstates/machine_large.json
3+
297d4e76f74478f078d7dacceb417e611ce0ec85 assets/compactmachines/blockstates/machine_maximum.json
4+
33c907f9d1ca01f77726966c0ff955b56637b877 assets/compactmachines/blockstates/machine_normal.json
5+
f235e57af63375b0bf48b6eabecab7074d8f06ef assets/compactmachines/blockstates/machine_small.json
6+
bb7d80f69e3ddb219302b58a556c2f5c4ba6dcb0 assets/compactmachines/blockstates/machine_tiny.json
7+
1f2b16b6aa527e2e4a63a71c2bc80681e8ce92b3 assets/compactmachines/blockstates/solid_wall.json
8+
1f2b16b6aa527e2e4a63a71c2bc80681e8ce92b3 assets/compactmachines/blockstates/wall.json
29
5209eb9eac1c0bf576abc4cbc5b63589508f3439 assets/compactmachines/models/block/machine/machine_giant.json
310
18afef1e36852ed4922c445ff417f8e63e72c331 assets/compactmachines/models/block/machine/machine_large.json
411
7ce6981c034b18fbc969db9f74eef0106c528a78 assets/compactmachines/models/block/machine/machine_maximum.json
@@ -12,26 +19,29 @@ bea2a57a336b22361580ae07d9bd6a5127d8d6af assets/compactmachines/models/item/mach
1219
871a0378d8459fbae1d17f6dddba6a56d9aa0380 assets/compactmachines/models/item/machine_normal.json
1320
50554f7ff7c5313b9b861837d5dd2e1f9fd8ab0d assets/compactmachines/models/item/machine_small.json
1421
dddd8574d998f7f8a67ab32fe7c8df074b3380af assets/compactmachines/models/item/machine_tiny.json
15-
84e5dc284b654bef91f8efc7c671164e4362217f assets/compactmachines/models/item/personal_shrinking_device.json
22+
10e68b769935b2a940c9c9e188b50b762e46eb6e assets/compactmachines/models/item/personal_shrinking_device.json
23+
1957ef1bf7541029e2bae7c56acae8e3bce9c491 assets/compactmachines/models/item/solid_wall.json
24+
33b46aafb4147f7cacd6254a2c93cde7a09791dc assets/compactmachines/models/item/tunnel.json
25+
1957ef1bf7541029e2bae7c56acae8e3bce9c491 assets/compactmachines/models/item/wall.json
1626
7611e10d6cb874469fee3209687504a964c1b7a5 data/compactmachines/advancements/claimed_machine_giant.json
1727
c221bb570100c820a1fe904064492fcdaf245120 data/compactmachines/advancements/claimed_machine_large.json
1828
82bae3a5d1558f86d39b69a31ef015ca25c64dc3 data/compactmachines/advancements/claimed_machine_max.json
1929
fe844f6dfc795652f9b3c659b72a1edbf1a84438 data/compactmachines/advancements/claimed_machine_normal.json
2030
f4bbe5fccc3b629f578958c90b84cce5776618d0 data/compactmachines/advancements/claimed_machine_small.json
2131
5e06a5ab20a4d26b4301e24457546b618b7cee7c data/compactmachines/advancements/claimed_machine_tiny.json
22-
29a4ead6392a01e2572b8047d84752ea461540e8 data/compactmachines/advancements/foundations.json
23-
e08cdedde718a20284432a33903792518801d66c data/compactmachines/advancements/got_shrinking_device.json
32+
7db9f6379ed353bf7fafff3da60b979487a53be3 data/compactmachines/advancements/foundations.json
33+
3a0fb8cddc24135ba15c7018398be318d6a63060 data/compactmachines/advancements/got_shrinking_device.json
2434
26f679025def0ce9b0a9ec9d0e5f6ee83ea50bc3 data/compactmachines/advancements/how_did_you_get_here.json
25-
e012e4b65799a56d195a6324c82e2cdf7a5a91be data/compactmachines/advancements/recipes/compactmachines/personal_shrinking_device.json
35+
d611c78e0b2b590bdbd5b17c37b295fb91739397 data/compactmachines/advancements/recipes/compactmachines/personal_shrinking_device.json
2636
fd7ccf69e4445ba0a2d7b2cd405ebe2ae85be240 data/compactmachines/advancements/recipes/compactmachines/wall.json
2737
2e9d5509d633970b1dd01bd99b535fd107e6e91a data/compactmachines/advancements/root.json
28-
fb5c7560898ae604661d0655c2a39e923eb1d4b4 data/compactmachines/loot_tables/blocks/machine_giant.json
29-
056d363f46ab1cc37c16f08428a3d2a9e0dd66d2 data/compactmachines/loot_tables/blocks/machine_large.json
30-
38a7648eb331daf18f5076126f31f31b6021ac51 data/compactmachines/loot_tables/blocks/machine_maximum.json
31-
212c5dbbbd0340d65b14661af6fedad70dbeabf8 data/compactmachines/loot_tables/blocks/machine_normal.json
32-
146f8a0b3b04224d2abb9051ec0f411c1bc501e4 data/compactmachines/loot_tables/blocks/machine_small.json
33-
4660cb18863036593d5ec879bd93f21571f1e5d5 data/compactmachines/loot_tables/blocks/machine_tiny.json
34-
5a1a6cc860595b0a2ebed37fad89cd9d924d4f58 data/compactmachines/loot_tables/blocks/wall.json
38+
8db7e50caf8d54a0e209fcd173b3f2e8461baf6a data/compactmachines/loot_tables/blocks/machine_giant.json
39+
19e7d71765db587639d5d09af0bee792cc222f83 data/compactmachines/loot_tables/blocks/machine_large.json
40+
6db7932ebd4de362a97bbffef28ec1e70b20ee45 data/compactmachines/loot_tables/blocks/machine_maximum.json
41+
94834ba82c55dc2095392c6bba870588a54843c7 data/compactmachines/loot_tables/blocks/machine_normal.json
42+
b17bb71ee964841011a833a69ef16cb4fd3acb82 data/compactmachines/loot_tables/blocks/machine_small.json
43+
493f48ba88eae8ee9431fb2da9bee7dd2f609877 data/compactmachines/loot_tables/blocks/machine_tiny.json
44+
2469b514d592ad18c98cde0228ecb12bc4e75b61 data/compactmachines/loot_tables/blocks/wall.json
3545
5fb413dd4c0417fa8ba1be75618482529b92a161 data/compactmachines/recipes/machine_giant.json
3646
b613629629931df8e56830f394af5bf22e995e55 data/compactmachines/recipes/machine_large.json
3747
2e038eb51a7f9807e562f0870a944a441944e84a data/compactmachines/recipes/machine_maximum.json

0 commit comments

Comments
 (0)