Fallen-Breath / MinecraftDataAPI

A MCDReforged api plugin to get player data information and more
GNU General Public License v3.0
17 stars 11 forks source link

Bug: Fail to Convert data #10

Closed CleMooling closed 1 year ago

CleMooling commented 1 year ago

MCDR Logs:

[MCDR] [21:39:52] [Gamemode switch mode/ERROR] [minecraft_data_api]: [Minecraft Data API] Fail to Convert data "CleMooling has the following entity data: "minecraft:o...": Invalid control character '[' at: line 1 column 3 (char 2)
Exception in thread Gamemode switch mode:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/mcdreforged/api/decorator/new_thread.py", line 29, in wrapped_target
    raise e from None
  File "/usr/local/lib/python3.10/dist-packages/mcdreforged/api/decorator/new_thread.py", line 26, in wrapped_target
    self.__return_value = target(*args_, **kwargs_)
  File "plugins/Gamemode-v1.0.1.mcdr/gamemode/__init__.py", line 87, in change_mode
  File "plugins/Gamemode-v1.0.1.mcdr/gamemode/__init__.py", line 286, in sur_to_spec
KeyError: None

Server Logs: [21:39:52] [Server thread/INFO]: CleMooling has the following entity data: "minecraft:overworld"

CleMooling commented 1 year ago

MCDR本体和插件版本皆为最新

Fallen-Breath commented 1 year ago

使用如下测试插件在 MC 1.19.4 vanilla 下测试,MinecraftDataAPI 可正常工作,无法复现解析失败的场景

from mcdreforged.api.decorator import new_thread

@new_thread
def on_user_info(server, info):
    if info.content == '!!dim' and info.is_player:
        import minecraft_data_api
        server.reply(info, minecraft_data_api.get_player_info(info.player, 'Dimension'))

建议给出详细完整的环境,包括服务端环境、MCDR 配置、第三方插件的详情、出现错误时完整的日志等

CleMooling commented 1 year ago

最近个人原因没什么时间整理有效信息,之后确认好了重新开个issue,抱歉打扰了