Skip to content

Commit be49b12

Browse files
committed
Fix NG wackiness and transformer
1 parent bebb25c commit be49b12

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ org.gradle.daemon=false
66
groovybundler_version=2.1.5
77

88
fml_version=4.0.8
9+
10+
# Ah, NG, my old nemesis...
11+
neogradle.subsystems.conventions.sourcesets.enabled=false

src/test/groovy/testmod/TestMod.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package testmod
77

8-
import net.neoforged.fml.common.EventBusSubscriber
98
import org.groovymc.gml.BaseGMod
109
import org.groovymc.gml.GMod
1110
import groovy.transform.CompileStatic

src/transform/groovy/org/groovymc/gml/transform/gmods/GEventBusSubscriberTransformer.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class GEventBusSubscriberTransformer extends AbstractASTTransformation {
2727
private static final ClassNode SUBSCRIBE_EVENT = ClassHelper.make(SubscribeEvent)
2828
private static final ClassNode MOD_BUS_EVENT = ClassHelper.make('net.neoforged.fml.event.IModBusEvent')
2929
private static final ClassNode NEOFORGE = ClassHelper.make('net.neoforged.neoforge.common.NeoForge')
30-
private static final ClassNode GML_MOD_LOADING_CONTEXT = ClassHelper.make('org.groovymc.gml.GMLModLoadingContext')
30+
private static final ClassNode MOD_LOADING_CONTEXT = ClassHelper.make('net.neoforged.fml.ModLoadingContext')
3131
private static final String GML_REGISTRATION_METHOD_NAME = 'gml$registerListeners'
3232

3333
private static BlockStatement buildRegistration(ClassNode node) {
@@ -53,7 +53,7 @@ class GEventBusSubscriberTransformer extends AbstractASTTransformation {
5353
return GeneralUtils.ifElseS(
5454
GeneralUtils.callX(GeneralUtils.classX(MOD_BUS_EVENT), 'isAssignableFrom', GeneralUtils.args(paramTypeExpression)),
5555
GeneralUtils.stmt(GeneralUtils.callX(
56-
GeneralUtils.callX(GeneralUtils.callX(new ClassExpression(GML_MOD_LOADING_CONTEXT), 'get'), 'getModEventBus'),
56+
GeneralUtils.callX(GeneralUtils.callX(GeneralUtils.callX(new ClassExpression(MOD_LOADING_CONTEXT), 'get'), 'getActiveContainer'), 'getEventBus'),
5757
'addListener',
5858
GeneralUtils.args(paramTypeExpression, methodReference)
5959
)),

0 commit comments

Comments
 (0)