diff --git a/sculptor-root/src/main/kotlin/io/papermc/sculptor/root/tasks/UpdateVersion.kt b/sculptor-root/src/main/kotlin/io/papermc/sculptor/root/tasks/UpdateVersion.kt index 7be8d26..222ded2 100644 --- a/sculptor-root/src/main/kotlin/io/papermc/sculptor/root/tasks/UpdateVersion.kt +++ b/sculptor-root/src/main/kotlin/io/papermc/sculptor/root/tasks/UpdateVersion.kt @@ -92,7 +92,7 @@ abstract class UpdateVersion : DefaultTask() { val nextVersion = run { val currentVersionIndex = mcManifest.versions.indexOf(latestExistingVersion) val nextVersionIndex = mcManifest.versions.withIndex() - .indexOfFirst { (idx, version) -> + .indexOfLast { (idx, version) -> idx < currentVersionIndex && (!type.isPresent || version.type == type.get()) } if (nextVersionIndex < 0) {