Extend constructor
Extend is very similar to File, but instead of creating a new file it adds content to an existing file.
So lets say we already have some files in our pack, but want to add something to the main file somewhere entirely else in our project:
Extend(
"main",
child: Command("say okay"),
first: true
)
This would add the command say okay
in front of our main.mcfunction.
Implementation
Extend(
this.path, {
this.child,
this.first = false,
this.inheritFolder = false,
}) {
path.replaceAll('.mcfunction', '');
if (path.substring(0, 1) == '/') path = path.substring(1);
}