Skip to content

Commit

Permalink
apply spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Aug 6, 2024
1 parent 91516b4 commit 4a7a987
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions plugin/src/main/kotlin/xyz/jpenilla/runpaper/RunPaperPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ public abstract class RunPaperPlugin : RunPlugin() {

override fun findPluginJar(task: TaskProvider<out RunWithPlugins>, project: Project): Provider<RegularFile>? {
if (project.plugins.hasPlugin(Constants.Plugins.PAPERWEIGHT_USERDEV_PLUGIN_ID)) {
val paperweight = project.extensions.getByType<PaperweightUserExtension>()
try {
project.configurations.getByName(DEV_BUNDLE_CONFIG).resolve()
} catch (ex: Exception) {
val error = GradleException("Failed to resolve dev bundle, cannot setup dev bundle runs. If you are clearing the paperweight cache, this is expected and can be ignored.", ex)
logger.error(error.message, error)
task.configure {
doFirst { throw error }
}
return null
val paperweight = project.extensions.getByType<PaperweightUserExtension>()
try {
project.configurations.getByName(DEV_BUNDLE_CONFIG).resolve()
} catch (ex: Exception) {
val error = GradleException("Failed to resolve dev bundle, cannot setup dev bundle runs. If you are clearing the paperweight cache, this is expected and can be ignored.", ex)
logger.error(error.message, error)
task.configure {
doFirst { throw error }
}
return null
}

return if (paperweight.minecraftVersion.get().minecraftVersionIsSameOrNewerThan(1, 20, 5)) {
super.findPluginJar(task, project)
} else {
project.tasks.named<RemapJar>(Constants.Plugins.PAPERWEIGHT_REOBF_JAR_TASK_NAME).flatMap { it.outputJar }
}
return if (paperweight.minecraftVersion.get().minecraftVersionIsSameOrNewerThan(1, 20, 5)) {
super.findPluginJar(task, project)
} else {
project.tasks.named<RemapJar>(Constants.Plugins.PAPERWEIGHT_REOBF_JAR_TASK_NAME).flatMap { it.outputJar }
}
}
return super.findPluginJar(task, project)
}
Expand Down

0 comments on commit 4a7a987

Please sign in to comment.