Skip to content

Commit

Permalink
dont break nbt files
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Dec 7, 2024
1 parent 27246cd commit e890332
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,17 @@ abstract class SetupVanilla : BaseTask() {
.forEach {
val target = outputPath.resolve(it.toString().substring(1))
target.parent.createDirectories()
// make sure we have a trailing newline
var content = it.readText()
if (!content.endsWith("\n")) {
content += "\n"
if (it.toString().endsWith(".nbt")) {
// nbt files are binary, so we can't just copy them
it.copyTo(target)
} else {
// make sure we have a trailing newline
var content = it.readText()
if (!content.endsWith("\n")) {
content += "\n"
}
target.writeText(content)
}
target.writeText(content)
}

println("Setup git repo...")
Expand Down

0 comments on commit e890332

Please sign in to comment.