Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

[BUG] 1.17.1与Fabric Language Scala共存时失效 #32

Closed
Kouchya opened this issue Aug 15, 2021 · 11 comments
Closed

[BUG] 1.17.1与Fabric Language Scala共存时失效 #32

Kouchya opened this issue Aug 15, 2021 · 11 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@Kouchya
Copy link

Kouchya commented Aug 15, 2021

Describe the bug
如标题所述,若同时安装了Fabric Language Scala模组,则本模组无法生效,游戏中输入法仍然会照常打开。

Client Software
PCL2 (MC: 1.17.1)

mods

  • Fabric API 0.37.2
  • ImBlockerFabric 1.0.14
  • Fabric Language Scala 1.1.0 + Scala 2.13.6

To Reproduce
Steps to reproduce the behavior:

  1. 向客户端mods文件夹中添加上述三个模组文件;
  2. 启动中文输入法(搜狗输入法或微软中文输入法均能触发此bug);
  3. 进入游戏按WASD等字母键,此时输入候选框弹出,按键对应的游戏功能未触发。

Expected behavior
按字母键时应触发对应的游戏功能,而非视为正在进行输入。

Environment (Please complete the following information):

  • OS: Windows 10 19042.1165
  • JRE: 16.0.2
@Kouchya Kouchya added the bug Something isn't working label Aug 15, 2021
@mrjesen
Copy link
Owner

mrjesen commented Aug 15, 2021

可否给一下Scala 2.13.6在curseforge上的链接?我没搜到

@plusls
Copy link
Collaborator

plusls commented Aug 15, 2021

emmm 我也没见过这个 mod,估计得提供以下日志和具体的 mod 链接

@Kouchya
Copy link
Author

Kouchya commented Aug 16, 2021

抱歉抱歉我没说清楚,那个模组本身就叫fabric-language-scala,版本号是1.1.0,只是文件名后面标注了它使用的scala语言版本😂

fabric-language-scala的链接是这个:https://www.curseforge.com/minecraft/mc-mods/fabric-language-scala/download/3392902/file

@plusls
Copy link
Collaborator

plusls commented Aug 16, 2021

抱歉抱歉我没说清楚,那个模组本身就叫fabric-language-scala,版本号是1.1.0,只是文件名后面标注了它使用的scala语言版本

fabric-language-scala的链接是这个:https://www.curseforge.com/minecraft/mc-mods/fabric-language-scala/download/3392902/file

是打上这个 mod 就会出问题的意思吗

你确定不是你还加了其他的 scala 写的 mod

@Kouchya
Copy link
Author

Kouchya commented Aug 16, 2021

不是,只要mods文件夹里有这两个模组就一定会出现这个情况,不需要其他依赖scala的模组。
有scala模组的情况下日志里会多出这么一段关于imblocker模组的报错:https://pastebin.com/sRuVU6rU

@plusls
Copy link
Collaborator

plusls commented Aug 16, 2021

不是,只要mods文件夹里有这两个模组就一定会出现这个情况,不需要其他依赖scala的模组。
有scala模组的情况下日志里会多出这么一段关于imblocker模组的报错:https://pastebin.com/sRuVU6rU

能否提供更完整的日志信息呢

@Kouchya
Copy link
Author

Kouchya commented Aug 16, 2021

不是,只要mods文件夹里有这两个模组就一定会出现这个情况,不需要其他依赖scala的模组。
有scala模组的情况下日志里会多出这么一段关于imblocker模组的报错:https://pastebin.com/sRuVU6rU

能否提供更完整的日志信息呢

https://pastebin.com/L0xQf5zR

@plusls
Copy link
Collaborator

plusls commented Aug 16, 2021

看起来是初始化 jni 的时候挂掉了,但是我不知道为啥

Caused by: java.lang.IllegalArgumentException: class com.sun.jna.platform.win32.WinNT$HANDLE is not a supported argument type (in method ImmDestroyContext in class com.ddwhm.jesen.imblocker.immanager.windows.WindowsImManager)

因为添加了 scala 语言支持导致这东西挂掉也太奇怪了

@plusls
Copy link
Collaborator

plusls commented Aug 16, 2021

虫我捉到了,我觉得不是 Imblocker 的问题,而是 fabric-language-scala 的问题,它自身提供了一个 jna,貌似和 java 自带的 jna 版本不一致

至少我开发环境的 Jna 是 5.8.0,但是 fabric-language-scala 自带了一个 jna,不知道发生了什么奇妙的事情,导致了

PointerType.class.isAssignableFrom(WinNT.HANDLE.class) = false

因此 Native.getConversion 返回了 -1,从而抛出这个错误

测试代码:

        ImBlocker.LOGGER.info("check WinNT.HANDLE {}", PointerType.class.isAssignableFrom(WinNT.HANDLE.class));
        ImBlocker.LOGGER.info("check WinDef.HWND {}", PointerType.class.isAssignableFrom(WinDef.HWND.class));
        ImBlocker.LOGGER.info("check WinDef.HWND {}", WinNT.HANDLE.class.isAssignableFrom(WinDef.HWND.class));

安装 mod 前:

[16:53:05] [Render thread/INFO]: check WinNT.HANDLE true
[16:53:05] [Render thread/INFO]: check WinDef.HWND true
[16:53:05] [Render thread/INFO]: check WinDef.HWND true

安装 mod 后:

[16:54:31] [Render thread/INFO]: check WinNT.HANDLE false
[16:54:31] [Render thread/INFO]: check WinDef.HWND false
[16:54:31] [Render thread/INFO]: check WinDef.HWND true

@plusls
Copy link
Collaborator

plusls commented Aug 16, 2021

往 fabric-language-scala 塞了个 issue (反正我觉得不是 imblocker 的锅

FabricMC/fabric-language-scala#17

@mrjesen
Copy link
Owner

mrjesen commented Aug 17, 2021

哈哈

@mrjesen mrjesen closed this as completed Aug 27, 2021
@mrjesen mrjesen added wontfix This will not be worked on and removed bug Something isn't working labels Aug 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants