WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 10 forks source link

[BUG] Loot table only declared once, throws an error "already declared" #56

Closed amqndin closed 1 year ago

amqndin commented 1 year ago

Describe the bug

"whip" loot table was only declared once but an error of duplicate declaration appears. this error can also be fixed if you import with a full path all the way from C: to project folder's subfolder.

To Reproduce

[Steps to reproduce the behavior]

  1. Download .zip
  2. Download beet, jmc-beet, and zip i attached in here
  3. drag the folder out of the archive
  4. open the root folder in terminal
  5. run 'beet' command in terminal

Expected behavior

To run and compile smoothly without any error messages.

Desktop

Additional context

i use latest unreleased JMC build from github, i compile all my code in beet environment, i use python 3.12 (but that bug first happened when i still was on 3.11). ZIP ARCHIVE bug bug bug.zip

Nico314159 commented 1 year ago

Is this specifically a jmc-beet issue? Or can it be replicated without beet?

amqndin commented 1 year ago

thats the thing, i dont know. but it has something to do with the path since if i type the import path all the way from c drive it will work fine and if i write the import path relative to project's folder it will break

Nico314159 commented 1 year ago

Turns out, this bug is actually a duplicate of #41.

The reason you are having this problem is because you did import "data/amandin/jmc/backend/*";. Changing it to import "data/amandin/jmc/backend/ddd"; or import "data/amandin/jmc/backend/jjj"; fixes the problem because then it means the loot table is only imported once and not twice.

WingedSeal commented 1 year ago

Fixed in https://github.com/WingedSeal/jmc/commit/d0a147598979fbd108f8a062797e62febdb96baf