Skip to content

Commit 983daa8

Browse files
authored
Fix compile issues (#378)
* target correct class for obf * delete class cache if its outdated
1 parent 26ae80d commit 983daa8

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/com/cleanroommc/groovyscript/core/mixin/groovy/CompUnitClassGenMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
1414

1515
@Pseudo
16-
@Mixin(targets = "org/codehaus/groovy/control/CompilationUnit$3", remap = false)
16+
@Mixin(targets = "org/codehaus/groovy/control/CompilationUnit$2", remap = false)
1717
public class CompUnitClassGenMixin {
1818

1919
@Inject(

src/main/java/com/cleanroommc/groovyscript/sandbox/CustomGroovyScriptEngine.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ CompiledScript checkScriptLoadability(File file) {
234234
comp.clazz = null;
235235
}
236236
comp.setRequiresReload(true);
237+
if (lastModified > comp.lastEdited) {
238+
// delete class bytes to make sure it's recompiled
239+
comp.deleteCache(this.cacheRoot.getPath());
240+
}
237241
if (lastModified > comp.lastEdited || comp.preprocessors == null) {
238242
// recompile preprocessors if there is no data or script was edited
239243
comp.preprocessors = Preprocessor.parsePreprocessors(file);

0 commit comments

Comments
 (0)