From 0e0166c7e3d0bf2433f8403a82b2d25f5a9c2d0b Mon Sep 17 00:00:00 2001 From: Adam Tunnic Date: Sat, 6 Mar 2021 15:56:12 -0500 Subject: [PATCH 1/3] Update Kotlin and PaperLib --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 13812f6..11343e2 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { plugins { id 'idea' - id 'org.jetbrains.kotlin.jvm' version '1.3.50' + id 'org.jetbrains.kotlin.jvm' version '1.4.10' id 'com.github.johnrengelman.shadow' version '2.0.4' } @@ -57,7 +57,7 @@ dependencies { compileOnly "com.destroystokyo.paper:paper-api:1.14.4-R0.1-SNAPSHOT" compileOnly "org.dynmap:dynmap-api:2.0" compileOnly group: 'org.xerial', name: 'sqlite-jdbc', version: '3.28.0' - compile "io.papermc:paperlib:1.0.2" + compile "io.papermc:paperlib:1.0.6" compile "org.bstats:bstats-bukkit:1.5" } @@ -83,4 +83,4 @@ compileTestKotlin { kotlinOptions { jvmTarget = "1.8" } -} \ No newline at end of file +} From 930ae728d0769d649fc89b2998d20f2d6abd70ec Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 7 Mar 2021 10:40:56 +0100 Subject: [PATCH 2/3] Add plugin version placeholder and bump version Signed-off-by: trivernis --- build.gradle | 12 +++++++++++- gradle.properties | 3 ++- src/main/resources/plugin.yml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 11343e2..8a63fda 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ idea { group "net.trivernis" -version "1.3.3" +version PLUGIN_VERSION sourceCompatibility = 1.8 @@ -73,6 +73,16 @@ jar { from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } +processResources { + with copySpec { + from 'src/main/resources/' + include '**/*' + filter { String line -> + line.replace('PLUGIN_VERSION', PLUGIN_VERSION) + } + } +} + compileKotlin { kotlinOptions { jvmTarget = "1.8" diff --git a/gradle.properties b/gradle.properties index 29e08e8..b1aea94 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ -kotlin.code.style=official \ No newline at end of file +kotlin.code.style=official +PLUGIN_VERSION=1.3.4 \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3275d5c..03f79bc 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: net.trivernis.chunkmaster.Chunkmaster name: Chunkmaster -version: '1.3.3' +version: PLUGIN_VERSION description: Automated world pregeneration. author: Trivernis website: trivernis.net From 49b1f8f1c7cc1848cfc75cf40d3f293d5817d9d9 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 7 Mar 2021 14:23:16 +0100 Subject: [PATCH 3/3] Fix warnings in build.gradle Signed-off-by: trivernis --- build.gradle | 21 +++++++++---------- .../chunkmaster/lib/LanguageManager.kt | 9 ++++++-- src/main/resources/plugin.yml | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 8a63fda..f4ef21f 100644 --- a/build.gradle +++ b/build.gradle @@ -46,19 +46,18 @@ repositories { maven { name 'mikeprimm' - url 'http://repo.mikeprimm.com' + url 'https://repo.mikeprimm.com' } } dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - testCompile group: 'junit', name: 'junit', version: '4.12' compileOnly "com.destroystokyo.paper:paper-api:1.14.4-R0.1-SNAPSHOT" compileOnly "org.dynmap:dynmap-api:2.0" compileOnly group: 'org.xerial', name: 'sqlite-jdbc', version: '3.28.0' - compile "io.papermc:paperlib:1.0.6" - compile "org.bstats:bstats-bukkit:1.5" + implementation "io.papermc:paperlib:1.0.6" + implementation "org.bstats:bstats-bukkit:1.5" } apply plugin: "com.github.johnrengelman.shadow" @@ -69,16 +68,13 @@ shadowJar { relocate 'org.bstats', 'net.trivernis.chunkmaster.bstats' } -jar { - from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } -} - processResources { + duplicatesStrategy = DuplicatesStrategy.INCLUDE with copySpec { from 'src/main/resources/' include '**/*' filter { String line -> - line.replace('PLUGIN_VERSION', PLUGIN_VERSION) + line.replace('$$PLUGIN_VERSION$$', PLUGIN_VERSION) } } } @@ -93,4 +89,7 @@ compileTestKotlin { kotlinOptions { jvmTarget = "1.8" } -} + dependencies { + compileOnly group: 'junit', name: 'junit', version: '4.12' + } +} \ No newline at end of file diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/LanguageManager.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/LanguageManager.kt index 4b19e74..5859489 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/LanguageManager.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/LanguageManager.kt @@ -56,8 +56,13 @@ class LanguageManager(private val plugin: Chunkmaster) { * Returns a localized message with replacements */ fun getLocalized(key: String, vararg replacements: Any): String { - val localizedString = langProps.getProperty(key) - return String.format(localizedString, *replacements) + try { + val localizedString = langProps.getProperty(key) + return String.format(localizedString, *replacements) + } catch (e: NullPointerException) { + plugin.logger.severe("Failed to get localized entry for $key") + throw e + } } /** diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 03f79bc..f51b143 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: net.trivernis.chunkmaster.Chunkmaster name: Chunkmaster -version: PLUGIN_VERSION +version: $$PLUGIN_VERSION$$ description: Automated world pregeneration. author: Trivernis website: trivernis.net