diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache/SetupVanilla.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache/SetupVanilla.kt index b8cd66133..5ca19a77c 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache/SetupVanilla.kt +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache/SetupVanilla.kt @@ -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...")