Skip to content
This repository has been archived by the owner on Jul 1, 2018. It is now read-only.

OpenPeripheral methods not showing #67

Closed
SquidDev opened this issue Sep 10, 2015 · 1 comment
Closed

OpenPeripheral methods not showing #67

SquidDev opened this issue Sep 10, 2015 · 1 comment
Assignees
Labels

Comments

@SquidDev
Copy link
Member

See http://www.computercraft.info/forums2/index.php?/topic/21987-mc-1710-cc-174-cc-tweaks/page__view__findpost__p__232231

Cannot patch openperipheral.interfaces.cc.ModuleComputerCraft, falling back to default
java.lang.IllegalStateException: Cannot find nodes for methods [Method{<clinit>}]
    LDC "computer"
    LDC Ldan200/computercraft/api/peripheral/IComputerAccess;.class
    INVOKEVIRTUAL openperipheral/adapter/composed/MethodSelector.addProvidedEnv (Ljava/lang/String;Ljava/lang/Class;)Lopenperipheral/adapter/composed/MethodSelector;

    at org.squiddev.patcher.visitors.FindingVisitor.visitEnd(FindingVisitor.java:102) ~[CCTweaks-1.7.10-0.2.2.jar:?]
    at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.accept(Unknown Source) ~[asm-all-5.0.3.jar:5.0.3]
    at org.squiddev.patcher.transformer.TransformationChain.transform(TransformationChain.java:42) ~[CCTweaks-1.7.10-0.2.2.jar:?]
    at org.squiddev.cctweaks.core.asm.ASMTransformer.transform(ASMTransformer.java:121) [CCTweaks-1.7.10-0.2.2.jar:?]

Changed from static constructor to normal constructor

Also, whilst we are doing this I forgot the call to nodes.accept(mv).

@SquidDev SquidDev added the bug label Sep 10, 2015
@SquidDev SquidDev self-assigned this Sep 10, 2015
@SquidDev
Copy link
Member Author

It might be worth re-writing this to remove the need for ASM injection.
The main type we need is the MethodSelector. This is stored in the ClassMethodComposer class which is stored in the ComposedMethodFactory class.

So we need to call PERIPHERAL_METHODS_FACTORY.composer.selector.addProvidedEnv(...). However the composer and selector fields are private.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant