mcbeet/mecha

/place template causes error during validation

2mal3 opened this issue · 2 comments

2mal3 commented

Validating a datapack (e.g. pack.zip) with a place template command (e.g. place template minecraft:fossil/spine_1 ~ ~ ~) leads to the following error:

Error: Plugin "mecha.cli.validate" raised an exception.

Traceback (most recent call last):
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/cli.py", line 30, in validate
    mc.compile(DataPack(path=path), report=mc.diagnostics)
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/api.py", line 432, in compile
    compilation_unit.ast = self.parse(
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/api.py", line 303, in parse
    ast = delegate(parser, stream)
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/parse.py", line 532, in delegate
    return spec.parsers[parser](stream)
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/parse.py", line 573, in parse_root
    commands.append(delegate("command", stream))
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/parse.py", line 532, in delegate
    return spec.parsers[parser](stream)
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/parse.py", line 638, in parse_command
    argument = delegate("command:argument", stream)
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/parse.py", line 532, in delegate
    return spec.parsers[parser](stream)
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/parse.py", line 692, in parse_argument
    return delegate(f"command:argument:{tree.parser}", stream)
  File "/home/user/Desktop/pack/venv/lib/python3.10/site-packages/mecha/parse.py", line 530, in delegate
    raise UnrecognizedParser(parser)
mecha.parse.UnrecognizedParser: command:argument:minecraft:template_rotation

I have noticed that this does not happen if you leave out the ~ at the end (only place template minecraft:fossil/spine_1).

Ooh good catch! Looks like we're missing an argument parser. I should be able to fix this later.

@2mal3 Just fixed it in 718c907. This is released in v0.54.8. If you're using the check-commands action you can bump mecha with the version input.