Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Fix recipe cache with LPF (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune authored Aug 20, 2023
1 parent 892435c commit 07ab41e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
30 changes: 17 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1690104383
//version: 1692122114
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -69,7 +69,7 @@ plugins {
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.21'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24'
}

print("You might want to check out './gradlew :faq' if your build fails.\n")
Expand Down Expand Up @@ -401,9 +401,13 @@ if (identifiedVersion == versionOverride) {

group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
archivesBaseName = customArchiveBaseName
base {
archivesName = customArchiveBaseName
}
} else {
archivesBaseName = modId
base {
archivesName = modId
}
}


Expand Down Expand Up @@ -558,9 +562,6 @@ repositories {
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
mavenContent {
excludeGroup("net.minecraftforge") // missing the `universal` artefact
}
}
maven {
name = "GTNH Maven"
Expand Down Expand Up @@ -627,6 +628,8 @@ def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec

def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'

dependencies {
if (usesMixins.toBoolean()) {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
Expand All @@ -638,7 +641,7 @@ dependencies {
}
}
if (usesMixins.toBoolean()) {
implementation(modUtils.enableMixins(mixinProviderSpec))
implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
}
Expand Down Expand Up @@ -691,8 +694,6 @@ if (file('dependencies.gradle.kts').exists()) {
throw new RuntimeException("Missing dependencies.gradle[.kts]")
}

def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'

tasks.register('generateAssets') {
group = "GTNH Buildscript"
description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed"
Expand Down Expand Up @@ -775,10 +776,10 @@ dependencies {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.19')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.26')
}

java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
java17PatchDependencies('net.minecraft:launchwrapper:1.17.2') {transitive = false}
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
Expand Down Expand Up @@ -1148,7 +1149,10 @@ tasks.named("processIdeaSettings").configure {

tasks.named("ideVirtualMainClasses").configure {
// Make IntelliJ "Build project" build the mod jars
dependsOn("jar", "reobfJar", "spotlessCheck")
dependsOn("jar", "reobfJar")
if (!disableSpotless) {
dependsOn("spotlessCheck")
}
}

// workaround variable hiding in pom processing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,19 @@ private static GT_Recipe.GT_Recipe_Map getRecipeMap(int aMode) {
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic() {

private ItemStack lastCircuit = null;

@NotNull
@Override
protected FindRecipeResult findRecipe(GT_Recipe.GT_Recipe_Map map) {
ItemStack circuit = getCircuit(inputItems);
if (circuit == null) {
return FindRecipeResult.NOT_FOUND;
}
if (!GT_Utility.areStacksEqual(circuit, lastCircuit)) {
lastRecipe = null;
lastCircuit = circuit;
}
GT_Recipe.GT_Recipe_Map foundMap = getRecipeMap(getCircuitID(circuit));
if (foundMap == null) {
return FindRecipeResult.NOT_FOUND;
Expand Down

0 comments on commit 07ab41e

Please sign in to comment.