question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to remap the reflect params? Help Wanted

See original GitHub issue

everything was remaped but the reflect params.

I have search on the fabric wiki(zh-cn) but got little message about that.

            //反射
            Field packetHandlers = NetworkState.class.getDeclaredField("packetHandlers");
            Field HANDLER_STATE_MAP = NetworkState.class.getDeclaredField("HANDLER_STATE_MAP");
            Class<?> PacketHandler = Class.forName("net.minecraft.network.NetworkState$PacketHandler");
            Method register = PacketHandler.getMethod("register", Class.class, Supplier.class);

I want to make it remaped, but dont know how to do. I know I can got the remaped name on the “yarn”, but I guess that if I remap it by myself, it would not work in the idea’s “runClient”. But I dont remap it, it cannot work but in the idea’s “runClient” and “runServer”.

Sorry for my poor English, Can anyone help me, please? Thanks. 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:56 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
FeelingBoredcommented, Jul 16, 2020

哦,你这个循环呼叫了 加载NetworkState的时候呼叫了你的PacketRegister,而你的PacketRegister以为NetworkState已经跑完<clinit>了。你只要在两个地方中间的一个把NetworkState的map放到你PacketRegister里面应该就行了

你的意思是指只保留一个“把NetworkState的map放到PacketRegister里面”的部分吗? 大概了解你的意思了,确实这样搞的话编译器也很烦恼要怎么做。

成功了!真的是太感谢你了! 按照着上面你们三位指导我的做法,我将注入NetworkState部分的代码全删了,用Accessor代替获取Handlers。 成功的代码 总感觉对这方面的理解稍为更进一步了,真的十分感谢你们!😃 (学到和认识了好多新东西,Accessor,access widener,以及Ctrl + Shift + F全局搜索原来要下载源码文件才能搜到…之前不会注入的时候,就靠这个搜例子…但因为没有下载源码的原因,几乎搜不到几个)

1reaction
liachcommented, Jul 16, 2020

哦,你这个循环呼叫了 加载NetworkState的时候呼叫了你的PacketRegister,而你的PacketRegister以为NetworkState已经跑完<clinit>了。你只要在两个地方中间的一个把NetworkState的map放到你PacketRegister里面应该就行了

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remap Extending G code - LinuxCNC
The recommended way to call an NGC procedure with a standard argspec parameter conversion. Used if argspec is good enough. Note it's not...
Read more >
How to show method parameter tooltip in C#? - Stack Overflow
Ctrl + Shift + Space will do what you want. You might want to check out a poster of key bindings.
Read more >
*remap - Documentation - Altair
Remaps a list of nodes to a line.
Read more >
Reflection Terminal Reference Manual for VT Hosts - Attachmate
Remap your keyboard using a graphical keyboard interface. This lets you assign any keystroke to a Reflection or host function.
Read more >
MigrationWiz - Advanced Options & General Options
We do not support recipient mapping for the actual MIME content, so email mime content-based migrations, such as Zimbra, won't have remapping ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found