@@ -54,7 +54,6 @@ final class RegistroidASTTransformer extends AbstractASTTransformation implement
5454 public static final Supplier<ClassNode > MODLIST = Suppliers . memoize { ClassHelper . make(' net.minecraftforge.fml.ModList' ) }
5555 public static final Supplier<ClassNode > FORGEBUS_GETTER = Suppliers . memoize { ClassHelper . make(' org.groovymc.cgl.reg.forge.ForgeBusGetter' ) }
5656
57- static final String REG_OBJECT_INTERNAL = Type . getInternalName(RegistryObject )
5857 @Override
5958 void visit (ASTNode [] nodes , SourceUnit source ) {
6059 init(nodes, source) // ensure that nodes is [AnnotationNode, AnnotatedNode]
@@ -424,8 +423,9 @@ final class RegistroidASTTransformer extends AbstractASTTransformation implement
424423 returnType : property. type,
425424 code : GeneralUtils . stmt(GeneralUtils . bytecodeX(property. type) {
426425 // (MyFieldType) MyClass.$registryObjectForMY_PROPERTY.get()
427- it. visitFieldInsn(Opcodes . GETSTATIC , classInternal, field. name, Type . getDescriptor(RegistryObject ))
428- it. visitMethodInsn(isForge ? Opcodes . INVOKEVIRTUAL : Opcodes . INVOKEINTERFACE , REG_OBJECT_INTERNAL , ' get' , ' ()Ljava/lang/Object;' , ! isForge)
426+ final typeInternal = getInternalName(regObjectType)
427+ it. visitFieldInsn(Opcodes . GETSTATIC , classInternal, field. name, " L$typeInternal ;" )
428+ it. visitMethodInsn(isForge ? Opcodes . INVOKEVIRTUAL : Opcodes . INVOKEINTERFACE , typeInternal, ' get' , ' ()Ljava/lang/Object;' , ! isForge)
429429 it. visitTypeInsn(Opcodes . CHECKCAST , getInternalName(property. type))
430430 })
431431 ])
0 commit comments