Skip to content

Commit f37f3d0

Browse files
committed
Merge branch 'enh/35' into 1.16.x
2 parents 1413fb4 + 46c5f6c commit f37f3d0

File tree

46 files changed

+925
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+925
-183
lines changed

.github/workflows/ci-tests-nightly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Gradle Tests and Nightly (CI)
22

33
on:
44
push:
5+
branches:
6+
- '**'
57
tags-ignore:
68
- v*
79
paths-ignore:

build.gradle

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins {
1313
id "idea"
1414
id "eclipse"
1515
id "maven-publish"
16+
id 'com.github.johnrengelman.shadow' version '7.1.0'
1617
}
1718

1819
apply plugin: "net.minecraftforge.gradle"
@@ -29,6 +30,12 @@ println("Version: ${version}");
2930

3031
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
3132

33+
configurations {
34+
library
35+
implementation.extendsFrom library
36+
shade.extendsFrom library
37+
}
38+
3239
sourceSets {
3340
api {
3441
java {
@@ -48,7 +55,8 @@ sourceSets {
4855
srcDir 'src/generated/resources'
4956
}
5057

51-
compileClasspath += compileClasspath += sourceSets.api.output
58+
runtimeClasspath += sourceSets.api.output
59+
compileClasspath += sourceSets.api.output
5260
}
5361

5462
test {
@@ -64,12 +72,8 @@ sourceSets {
6472
}
6573

6674
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
75+
6776
minecraft {
68-
// The mappings can be changed at any time, and must be in the following format.
69-
// snapshot_YYYYMMDD Snapshot are built nightly.
70-
// stable_# Stables are built at the discretion of the MCP team.
71-
// Use non-default mappings at your own risk. they may not always work.
72-
// Simply re-run your setup task after changing the mappings to update your workspace.
7377
mappings channel: 'official', version: minecraft_version
7478
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
7579
def resourcesDir = sourceSets.main.resources.srcDirs.first().absolutePath
@@ -81,6 +85,9 @@ minecraft {
8185
client {
8286
workingDirectory project.file('run/client')
8387

88+
property 'mixin.env.remapRefMap', 'true'
89+
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
90+
8491
// Recommended logging data for a userdev environment
8592
property 'forge.logging.markers', '' // 'SCAN,REGISTRIES,REGISTRYDUMP'
8693

@@ -243,9 +250,14 @@ dependencies {
243250

244251
testImplementation fg.deobf("com.github.alcatrazEscapee:mcjunitlib:${mcunittest_version}")
245252

253+
library "io.reactivex.rxjava3:rxjava:3.1.1";
254+
246255
// Deobfuscate each dev mod for runtime
247256
dev_mods.each { implementation fg.deobf(it) }
248257

258+
runtimeOnly(fg.deobf("curse.maven:nicephore-401014:3318114"))
259+
runtimeOnly(fg.deobf("curse.maven:sues-407174:3188120"))
260+
249261
// JEI
250262
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
251263
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")
@@ -263,12 +275,39 @@ processTestResources {
263275
duplicatesStrategy = DuplicatesStrategy.WARN
264276
}
265277

278+
assemble {
279+
dependsOn shadowJar
280+
}
281+
282+
reobf {
283+
shadowJar {}
284+
}
285+
286+
tasks.withType(Jar).configureEach {
287+
destinationDir = file("$rootDir/build-out")
288+
}
289+
290+
shadowJar {
291+
classifier ""
292+
from sourceSets.api.output
293+
from sourceSets.main.output
294+
295+
configurations = [project.configurations.shade]
296+
exclude "LICENSE*"
297+
finalizedBy 'reobfShadowJar'
298+
minimize()
299+
relocate 'io.reactivex', 'dev.compactmods.crafting.lib.reactivex'
300+
relocate 'org.reactivestreams', 'dev.compactmods.crafting.lib.reactivestreams'
301+
}
302+
266303
jar {
304+
classifier "slim"
305+
267306
from sourceSets.api.output
268307
from sourceSets.main.output
269308

270-
destinationDir = file("$rootDir/build-out")
271309
finalizedBy('reobfJar')
310+
272311
manifest {
273312
attributes([
274313
"Specification-Title" : "compactcrafting",
@@ -284,31 +323,28 @@ jar {
284323
task apiJar(type: Jar) {
285324
// Sources included because of MinecraftForge/ForgeGradle#369
286325
from sourceSets.api.output
287-
destinationDirectory = file("$rootDir/build-out")
288326
classifier("api")
289327
}
290328

291329
task testJar(type: Jar) {
292330
from sourceSets.api.output
293331
from sourceSets.main.output
294332
from sourceSets.test.output
295-
destinationDirectory = file("$rootDir/build-out")
296333
classifier("tests")
297334
}
298335

299336
artifacts {
300-
archives jar, apiJar, testJar
337+
archives jar, shadowJar, apiJar, testJar
301338
}
302339

303340
publishing {
304341
publications {
305342
maven(MavenPublication) {
306343
artifactId = mod_id
307344
artifacts {
308-
artifact jar
309-
artifact(apiJar) {
310-
classifier = "api"
311-
}
345+
artifact(jar)
346+
artifact(shadowJar)
347+
artifact(apiJar)
312348
artifact(testJar)
313349
}
314350
}
@@ -317,9 +353,8 @@ publishing {
317353
artifactId = mod_id
318354
artifacts {
319355
artifact(jar)
320-
artifact(apiJar) {
321-
classifier = "api"
322-
}
356+
artifact(shadowJar)
357+
artifact(apiJar)
323358
artifact(testJar)
324359
}
325360
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ minecraft_version=1.16.5
77
forge_version=36.1.3
88

99
mod_id=compactcrafting
10-
mod_version=1.0.0-beta.7
10+
mod_version=1.0.0
1111

1212
# Dependencies and Libs
1313
jei_version=7.7.1.110
@@ -16,4 +16,4 @@ mcunittest_version=1.8.1-1.16.5
1616

1717
# Curseforge
1818
cf_project=429735
19-
cf_release_type=beta
19+
cf_release_type=release
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package dev.compactmods.crafting.api.catalyst;
2+
3+
import com.mojang.serialization.Codec;
4+
import net.minecraftforge.registries.IForgeRegistryEntry;
5+
6+
public interface CatalystType<Matcher extends ICatalystMatcher> extends IForgeRegistryEntry<CatalystType<?>> {
7+
8+
Codec<Matcher> getCodec();
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package dev.compactmods.crafting.api.catalyst;
2+
3+
import java.util.Set;
4+
import net.minecraft.item.ItemStack;
5+
6+
public interface ICatalystMatcher {
7+
8+
boolean matches(ItemStack stack);
9+
10+
CatalystType<?> getType();
11+
12+
Set<ItemStack> getPossible();
13+
}

src/api/java/dev/compactmods/crafting/api/field/IActiveWorldFields.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.Optional;
44
import java.util.stream.Stream;
5+
import net.minecraft.util.RegistryKey;
56
import net.minecraft.util.math.BlockPos;
67
import net.minecraft.util.math.ChunkPos;
78
import net.minecraft.world.World;
@@ -32,4 +33,6 @@ default void addFieldInstance(IMiniaturizationField field) {}
3233
boolean hasActiveField(BlockPos center);
3334

3435
Stream<IMiniaturizationField> getFields(ChunkPos chunk);
36+
37+
RegistryKey<World> getLevel();
3538
}

src/api/java/dev/compactmods/crafting/api/field/IMiniaturizationField.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
public interface IMiniaturizationField {
1515

16+
default void dispose() {}
17+
1618
AxisAlignedBB getBounds();
1719

1820
MiniaturizationFieldSize getFieldSize();
@@ -55,8 +57,6 @@ default CompoundNBT serverData() {
5557
return new CompoundNBT();
5658
}
5759

58-
default void loadServerData(CompoundNBT nbt) {}
59-
6060
default CompoundNBT clientData() {
6161
CompoundNBT data = new CompoundNBT();
6262
data.putLong("center", getCenter().asLong());

src/api/java/dev/compactmods/crafting/api/recipe/IMiniaturizationRecipe.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
import java.util.Collection;
44
import java.util.Optional;
55
import java.util.stream.Stream;
6+
import dev.compactmods.crafting.api.catalyst.ICatalystMatcher;
67
import dev.compactmods.crafting.api.components.IRecipeComponents;
78
import dev.compactmods.crafting.api.recipe.layers.IRecipeLayer;
89
import net.minecraft.item.ItemStack;
910
import net.minecraft.util.ResourceLocation;
1011
import net.minecraft.util.math.AxisAlignedBB;
1112

1213
public interface IMiniaturizationRecipe {
13-
ItemStack getCatalyst();
14+
ICatalystMatcher getCatalyst();
1415

1516
ItemStack[] getOutputs();
1617

src/generated/resources/.cache/cache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ a558989a04a5f19ef48638d1c8046fa657648b44 data/compactcrafting/advancements/recip
1717
45d2dbdc5645834115bb56999d16420aa9629948 data/compactcrafting/advancements/recipes/compactcrafting/projector_dish.json
1818
c1907f3b4dd836b38f84b64e45f2ff6cb691a8fd data/compactcrafting/advancements/recipes/compactcrafting/rescan_proxy.json
1919
665dc63cdbb86e785cf9171a63f83d034a3584ef data/compactcrafting/loot_tables/blocks/field_projector.json
20+
01706dcd83634eea9ad27be909b4a789cfc80d33 data/compactcrafting/loot_tables/blocks/match_proxy.json
21+
7114601a2207f87b722bef4b3bf2fbe11c975073 data/compactcrafting/loot_tables/blocks/rescan_proxy.json
2022
4afba1a945aad9b9fc0e748bf9ee46d7aeb01a70 data/compactcrafting/recipes/base.json
2123
b4bb22914fb3c6cbcef342b0f92a5148b35a0647 data/compactcrafting/recipes/field_projector.json
2224
e87defaaae5226e24b25a72934767c19208868c6 data/compactcrafting/recipes/match_proxy.json
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"name": "compactcrafting:match_proxy",
6+
"rolls": 1,
7+
"entries": [
8+
{
9+
"type": "minecraft:item",
10+
"name": "compactcrafting:match_proxy"
11+
}
12+
],
13+
"conditions": [
14+
{
15+
"condition": "minecraft:survives_explosion"
16+
}
17+
]
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)