Skip to content

Commit 448435f

Browse files
committed
update groovy to 4.0.21
1 parent ec4b87b commit 448435f

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ modGroup = com.cleanroommc.groovyscript
4545
# Version of your mod.
4646
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
4747
modVersion = 1.0.1
48-
groovy_version = 4.0.13
48+
groovy_version = 4.0.21
4949
debug_use_examples_folder = true
5050
debug_run_ls = false
5151

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import net.minecraftforge.fml.relauncher.FMLLaunchHandler;
55
import org.codehaus.groovy.ast.Parameter;
66
import org.codehaus.groovy.ast.*;
7+
import org.codehaus.groovy.ast.expr.ConstantExpression;
8+
import org.codehaus.groovy.ast.stmt.ReturnStatement;
79
import org.codehaus.groovy.vmplugin.v8.Java8;
810
import org.spongepowered.asm.mixin.Mixin;
911
import org.spongepowered.asm.mixin.Overwrite;
@@ -28,13 +30,6 @@ public abstract class Java8Mixin {
2830
@Shadow
2931
protected abstract ClassNode[] makeClassNodes(CompileUnit cu, Type[] types, Class<?>[] cls);
3032

31-
@Shadow
32-
private static void setMethodDefaultValue(MethodNode mn, Method m) {
33-
}
34-
35-
@Shadow
36-
protected abstract GenericsType[] configureTypeVariable(TypeVariable<?>[] tvs);
37-
3833
@Shadow
3934
protected abstract Annotation[][] getConstructorParameterAnnotations(Constructor<?> constructor);
4035

@@ -47,6 +42,9 @@ private static void setMethodDefaultValue(MethodNode mn, Method m) {
4742
@Shadow
4843
protected abstract void makeRecordComponents(CompileUnit cu, ClassNode classNode, Class<?> clazz);
4944

45+
@Shadow
46+
protected abstract GenericsType[] configureTypeParameters(TypeVariable<?>[] tp);
47+
5048
/**
5149
* @author brachy84
5250
* @reason remapping minecraft fields and methods
@@ -72,10 +70,13 @@ public void configureClassNode(final CompileUnit compileUnit, final ClassNode cl
7270
ClassNode[] exceptions = makeClassNodes(compileUnit, m.getGenericExceptionTypes(), m.getExceptionTypes());
7371
String name = deobfMethods != null ? deobfMethods.getOrDefault(m.getName(), m.getName()) : m.getName();
7472
MethodNode mn = new MethodNode(name, m.getModifiers(), ret, params, exceptions, null);
75-
mn.setSynthetic(m.isSynthetic());
76-
setMethodDefaultValue(mn, m);
7773
setAnnotationMetaData(m.getAnnotations(), mn);
78-
mn.setGenericsTypes(configureTypeVariable(m.getTypeParameters()));
74+
if (true) { // TODO: GROOVY-10862
75+
mn.setAnnotationDefault(true);
76+
mn.setCode(new ReturnStatement(new ConstantExpression(m.getDefaultValue())));
77+
}
78+
mn.setGenericsTypes(configureTypeParameters(m.getTypeParameters()));
79+
mn.setSynthetic(m.isSynthetic());
7980
classNode.addMethod(mn);
8081
}
8182
Constructor<?>[] constructors = clazz.getDeclaredConstructors();

0 commit comments

Comments
 (0)