minecraft-py / minecraft

A Minecraft-like game written in python3
GNU General Public License v3.0
157 stars 25 forks source link

can't run #37

Closed 00zzh closed 2 years ago

00zzh commented 2 years ago

Operating System

Windows

Python

python3.10.5

Issue

When I start "run.bat",it shows:

Traceback (most recent call last):
  File "D:\Python\Python3.10.5\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\Python\Python3.10.5\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\下载\Minecraft-master\minecraft\__main__.py", line 12, in <module>
    from minecraft.scene import GameWindow
  File "D:\下载\Minecraft-master\minecraft\scene\__init__.py", line 4, in <module>
    from minecraft.sources import *
  File "D:\下载\Minecraft-master\minecraft\sources.py", line 43, in <module>
    if not re.match("^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$", player["id"]):
KeyError: 'id'

I delete "mcpy" and try again but it still doesn't work.

zhengxyz123 commented 2 years ago

很遗憾,我没有成功复现此问题,但我可以提供以下的解决方案:

  1. 找到文件mcpy/player.json
  2. 检查它的内容是否符合
    {
        "<一个uuid>": {
            "name": "..."
        }
    }
  3. 若不符合则改成如上格式(在最新的版本中)
zhengxyz123 commented 2 years ago

我已更新install.py,可以运行之解决问题。

00zzh commented 2 years ago

我已更新install.py,可以运行之解决问题。

报错还是一样的。很奇怪,在另一台同样环境的电脑上能正常运行

zhengxyz123 commented 2 years ago

刚刚已经更新minecraft/source.py的代码,问题已解决,请再次尝试。

记得运行install.py啊!

00zzh commented 2 years ago

刚刚已经更新minecraft/source.py的代码,问题已解决,请再次尝试。

感谢!可以正常启动了,但是好像没法新建存档诶

00zzh commented 2 years ago

单人游戏点开后是空的

zhengxyz123 commented 2 years ago

那有没有一种可能:作者还没有做好呢?

Mojang 把那个界面设计得非常麻烦,需要时间琢磨一下OpenGL的功能。

zhengxyz123 commented 2 years ago

说句不负责任的话:既然已经解决了阁下遇见的问题,那此issue就可以关闭了。

谢谢您的建议:)