Use Ktfmt (Kotlin-style) using Spotless
This commit is contained in:
3 files changed
+16
-4
No files matched your search
@@ -4,6 +4,7 @@ plugins {
|
||||
kotlin("jvm") version "2.1.21"
|
||||
id("io.papermc.paperweight.userdev") version "2.0.0-beta.17"
|
||||
id("com.gradleup.shadow") version "8.3.6"
|
||||
id("com.diffplug.spotless") version "7.0.4"
|
||||
eclipse
|
||||
}
|
||||
|
||||
@@ -53,6 +54,7 @@ tasks.assemble {
|
||||
}
|
||||
|
||||
tasks.build {
|
||||
dependsOn(tasks.spotlessApply)
|
||||
dependsOn(tasks.shadowJar)
|
||||
}
|
||||
|
||||
@@ -94,3 +96,10 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
spotless {
|
||||
kotlin {
|
||||
ktfmt().kotlinlangStyle().configure {
|
||||
it.setMaxWidth(120)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import java.util.*
|
||||
|
||||
object Helper {
|
||||
private var boatTimeout: MutableMap<UUID, Long> = HashMap()
|
||||
|
||||
fun getBoatTimeout(uuid: UUID): Long {
|
||||
val cooldown: Long
|
||||
if (!boatTimeout.containsKey(uuid)) {
|
||||
|
||||
@@ -57,9 +57,10 @@ class RewindFixOG : JavaPlugin() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, 0L, 1L)
|
||||
protocolManager.addPacketListener(object :
|
||||
PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.STEER_VEHICLE) {
|
||||
}
|
||||
.runTaskTimer(this, 0L, 1L)
|
||||
protocolManager.addPacketListener(
|
||||
object : PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.STEER_VEHICLE) {
|
||||
override fun onPacketReceiving(event: PacketEvent) {
|
||||
val player = event.player
|
||||
val api = Via.getAPI()
|
||||
@@ -102,7 +103,8 @@ class RewindFixOG : JavaPlugin() {
|
||||
Bukkit.getScheduler().runTask(plugin, MoveHorseRunnable(nmsHorse, vec))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
this.server.pluginManager.registerEvents(Events(), this)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user