File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patchroulette Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ abstract class PatchRouletteApply : AbstractPatchRouletteTask() {
8989 var tries = 5
9090 var patches = listOf<Path >()
9191 val patchSelectionStrategy = patchSelectionStrategy
92- .map { parsePatchSelectionStrategy (it) }
92+ .map { PatchSelectionStrategy .parse (it) }
9393 .getOrElse(PatchSelectionStrategy .NumericInPackage (5 ))
9494 while (tries > 0 ) {
9595 val available = getAvailablePatches().map { Path (it) }.toMutableSet()
@@ -178,13 +178,15 @@ abstract class PatchRouletteApply : AbstractPatchRouletteTask() {
178178 }
179179
180180 fun select (config : Config , available : List <Path >): Pair <Config , List <Path >>
181- }
182181
183- private fun parsePatchSelectionStrategy (input : String ): PatchSelectionStrategy {
184- try {
185- return PatchSelectionStrategy .NumericInPackage (input.toInt())
186- } catch (e: Exception ) {
187- throw PaperweightException (" Failed to parse patch selection strategy $input " , e)
182+ companion object {
183+ fun parse (input : String ): PatchSelectionStrategy {
184+ try {
185+ return NumericInPackage (input.toInt())
186+ } catch (e: Exception ) {
187+ throw PaperweightException (" Failed to parse patch selection strategy $input " , e)
188+ }
189+ }
188190 }
189191 }
190192}
You can’t perform that action at this time.
0 commit comments