Skip to content

Commit 8722086

Browse files
committed
fix issues relating to some root structure changes
1 parent 59e2618 commit 8722086

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mm/ApplyServerSourceAndNmsPatches.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ abstract class ApplyServerSourceAndNmsPatches : BaseTask() {
5959
if (paperDecompiledSource.isPresent && Files.notExists(nmsFile)) {
6060
nmsFile = paperDecompiledSource.file(fileName).get().path
6161
}
62+
if (Files.notExists(nmsFile)) {
63+
// we add new files within src/main/resources/data/minecraft/ but they don't exist in the nms source
64+
return@forEach
65+
}
6266
val patchFile = patchDir.resolve(fileName).resolveSibling((patchedFile.name + ".patch")) // keep extension
6367

6468
val commandText =
@@ -85,9 +89,9 @@ abstract class ApplyServerSourceAndNmsPatches : BaseTask() {
8589
val patchName = patch.name.split("-", limit = 2)[1]
8690
println("Applying Patch: $patchName")
8791
val excludeArray = directoriesToPatch.get().map { "--exclude=$it/**" }.toTypedArray()
88-
git("am", "--ignore-whitespace", *excludeArray, patch.toPath().absolutePathString()).execute()
92+
git("am", "--ignore-whitespace", "--include=src/main/resources/data/minecraft/datapacks/paper/**", *excludeArray, "--include=**", patch.toPath().absolutePathString()).execute()
8993
val includeArray = directoriesToPatch.get().map { "--include=$it/**" }.toTypedArray()
90-
git("apply", "--ignore-whitespace", *includeArray, patch.toPath().absolutePathString()).execute()
94+
git("apply", "--ignore-whitespace", "--exclude=src/main/resources/data/minecraft/datapacks/paper/**", *includeArray, patch.toPath().absolutePathString()).execute()
9195

9296
val (sourceFiles, dataFiles) = McDev.readPatchLines(listOf(patch.toPath()))
9397
createPerFileDiff(sourcePatchesDir, sourceFiles, "src/main/java/")

paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mm/filterrepo/FinalizePaperHistory.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,13 @@ abstract class FinalizePaperHistory : BaseTask() {
3232
@TaskAction
3333
fun run() {
3434
Git.checkForGit()
35+
val deletionsArr = deletions.get().toTypedArray()
36+
if (deletionsArr.isEmpty()) {
37+
return
38+
}
3539
Git(paperDir).let { git ->
36-
val paperMojangApi = outputDir.path.resolve("Paper-MojangAPI/src/main/java")
37-
paperMojangApi.copyRecursivelyTo(outputDir.path.resolve("paper-api/src/main/java"))
38-
paperMojangApi.deleteRecursive()
39-
git("add", "paper-api/src/main/java", "Paper-MojangAPI").execute()
40-
git("commit", "--message", "Merge Paper-MojangAPI into Paper API", "--author=Automated <[email protected]>").execute()
41-
42-
val deletionsArr = deletions.get().toTypedArray()
43-
if (deletionsArr.isNotEmpty()) {
44-
git("rm", "-r", *deletionsArr).execute()
45-
git("commit", "-m", "OWW! That fork is HARD!", "--author=Automated <[email protected]>").execute()
46-
}
40+
git("rm", "-r", *deletionsArr).execute()
41+
git("commit", "-m", "OWW! That fork is HARD!", "--author=Automated <[email protected]>").execute()
4742
}
4843
}
4944
}

0 commit comments

Comments
 (0)