Skip to content

Commit

Permalink
fix: no NPE on reload
Browse files Browse the repository at this point in the history
chore: auto replace version
  • Loading branch information
MC-XiaoHei committed Feb 5, 2024
1 parent 861fc7b commit 1be53fd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id("java")
Expand All @@ -7,7 +8,7 @@ plugins {
}

group = "cn.xor7"
version = "1.0.1"
version = "1.0.2"

repositories {
mavenLocal()
Expand All @@ -31,6 +32,19 @@ java {
}
}

tasks.processResources {
filesMatching("paper-plugin.yml") {
expand(
mapOf(
"version" to version,
)
)
}
}




tasks.withType<JavaCompile>().configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible) {
options.release.set(targetJavaVersion)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/xor7/iseeyou/EventListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object EventListener : Listener {

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
fun onPlayerQuit(event: PlayerQuitEvent) {
val photographer: Photographer = photographers[event.player.uniqueId.toString()]!!
val photographer: Photographer = photographers[event.player.uniqueId.toString()] ?: return
highSpeedPausedPhotographers.remove(photographer)
if (toml!!.data.pauseInsteadOfStopRecordingOnPlayerQuit) {
photographer.resumeRecording()
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ISeeYou
version: '1.0.1'
version: ${version}
main: cn.xor7.iseeyou.ISeeYou
api-version: '1.20'

0 comments on commit 1be53fd

Please sign in to comment.