SethBling / cbscript

CBScript for Minecraft
1.13k stars 28 forks source link

Add ability to copy a data folder #25

Open Mystievous opened 3 months ago

Mystievous commented 3 months ago

Some datapacks benefit from including structures and similar files.

This PR adds the ability to define a data folder to directly copy into the compiled pack. The folder should have the exact same directory structure as the data directory in a datapack.

The data key is optional, and placed after the dir and desc, before scale

Example:

dir "<World Dir>"
desc "Pack Description"
data "./pack_data"
scale 1000
./pack_data
-> namespace
----> structures
-------> structure.nbt

The files are copied after any other ones from the script are created, so that files with duplicate names can be ignored. i.e. function test() in the cbscript will essentially override test.mcfunction in the same namespace in the data folder if it happens to be there.