Skip to content

1.20.x Docker Image issue with older versions of minecraft #5

@akr4s1a

Description

@akr4s1a

I got 1.19 to work fine but 1.18 and below is giving me issue,
Targeting the 1.18.2.jar will produce

sudo docker run --rm -v $(pwd):/wd -w /wd -e LOCAL_USER_ID=$(id -u $(whoami)) miclav/blockcrafter -a 118.jar -o blocks118 -v topdown -t 16
Running as user 1001
WARNING: VISPY_GL_LIB is ignored when using OSMesa. Use OSMESA_LIBRARY instead.
Adding asset source: 118.jar
Traceback (most recent call last):
  File "/usr/local/bin/blockcrafter-export", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/export.py", line 223, in main
    c = Canvas(args)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/export.py", line 80, in __init__
    self.assets = mcmodel.Assets.create(self.args.assets)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/mcmodel.py", line 402, in create
    source = create_source(path)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/mcmodel.py", line 88, in create_source
    return ZipFileSource(path)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/mcmodel.py", line 114, in __init__
    self.zip = zipfile.ZipFile(path)
  File "/usr/local/lib/python3.9/zipfile.py", line 1257, in __init__
    self._RealGetContents()
  File "/usr/local/lib/python3.9/zipfile.py", line 1324, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Targeting a texture pack for 1.18 results in

sudo docker run --rm -v $(pwd):/wd -w /wd -e LOCAL_USER_ID=$(id -u $(whoami)) miclav/blockcrafter -a 118.zip -o blocks118 -v topdown -t 16
Running as user 1001
WARNING: VISPY_GL_LIB is ignored when using OSMesa. Use OSMESA_LIBRARY instead.
Adding asset source: 118.zip
blocks118/topdown_0_16.png
WARNING: Traceback (most recent call last):
  File "/usr/local/bin/blockcrafter-export", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/export.py", line 224, in main
    app.run()
  File "/usr/local/lib/python3.9/site-packages/vispy/app/_default_app.py", line 62, in run
    return default_app.run()
  File "/usr/local/lib/python3.9/site-packages/vispy/app/application.py", line 142, in run
    return self._backend._vispy_run()
  File "/usr/local/lib/python3.9/site-packages/vispy/app/backends/_osmesa.py", line 75, in _vispy_run
    self._vispy_process_events()
  File "/usr/local/lib/python3.9/site-packages/vispy/app/backends/_osmesa.py", line 70, in _vispy_process_events
    win._on_draw()
  File "/usr/local/lib/python3.9/site-packages/vispy/app/backends/_osmesa.py", line 216, in _on_draw
    self._vispy_canvas.events.draw(region=None)  # (0, 0, w, h)
  File "/usr/local/lib/python3.9/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/usr/local/lib/python3.9/site-packages/vispy/util/event.py", line 473, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  << caught exception here: >>
  File "/usr/local/lib/python3.9/site-packages/PIL/Image.py", line 2770, in open
    fp.seek(0)
AttributeError: 'NoneType' object has no attribute 'seek'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/export.py", line 202, in on_draw
    self.render_blocks(blockstates, texture_size, view, rotation, info_path, image_path)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/export.py", line 163, in render_blocks
    glblock.render(conditions, variant_idx, actual_model, view, projection, rotation=rotation, mode=mode)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/render.py", line 545, in render
    self.conditions[condition_str] = self._load_condition(condition, alt)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/render.py", line 538, in _load_condition
    self.models[model.name] = Model(model)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/render.py", line 510, in __init__
    self.elements.append(Element(modeldef, elementdef))
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/render.py", line 285, in __init__
    self.faces = Element.load_faces(model, element)
  File "/usr/local/lib/python3.9/site-packages/blockcrafter/render.py", line 446, in load_faces
    image = Image.open(f).convert("RGBA")
  File "/usr/local/lib/python3.9/site-packages/PIL/Image.py", line 2772, in open
    fp = io.BytesIO(fp.read())
AttributeError: 'NoneType' object has no attribute 'read'
ERROR: Invoking <bound method Canvas.on_draw of <Canvas (osmesa) at 0x7f46b48f4d30>> for DrawEvent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions