Skip to content

Commit 5eb683e

Browse files
authored
chore: finish Java 17 bump in libs and use Message.sendTo in PinCommand (#41)
Two small cleanups salvaged from the closed #36 that #40 didn't pick up: - buildSrc/LibsConfig.kt: bump the libs module's source/target compatibility and TARGET_JVM_VERSION attribute from 1.8 to 17, matching the v8 Java 17 baseline already applied to the rest of the project in #40. - PinCommand.java: replace the two remaining sender.sendMessage(Message.get(...).toString()) calls with Message.get(...).sendTo(sender) so error messages render through the MiniMessage pipeline like the other pin messages instead of as the raw Component.toString() output.
1 parent 6d3fa3a commit 5eb683e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

buildSrc/src/main/kotlin/LibsConfig.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ fun Project.applyLibrariesConfiguration() {
3535
}
3636

3737
plugins.withId("java") {
38-
the<JavaPluginExtension>().setSourceCompatibility("1.8")
39-
the<JavaPluginExtension>().setTargetCompatibility("1.8")
38+
the<JavaPluginExtension>().setSourceCompatibility("17")
39+
the<JavaPluginExtension>().setTargetCompatibility("17")
4040
}
4141

4242
group = "${rootProject.group}.BanManagerWebEnhancerLibs"
@@ -89,7 +89,7 @@ fun Project.applyLibrariesConfiguration() {
8989
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
9090
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.SHADOWED))
9191
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
92-
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
92+
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
9393
}
9494
outgoing.artifact(tasks.named("jar"))
9595
}
@@ -104,7 +104,7 @@ fun Project.applyLibrariesConfiguration() {
104104
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
105105
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.SHADOWED))
106106
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
107-
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
107+
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
108108
}
109109
outgoing.artifact(tasks.named("jar"))
110110
}

common/src/main/java/me/confuser/banmanager/webenhancer/common/commands/PinCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ public boolean onCommand(CommonSender sender, CommandParser parser) {
4242
try {
4343
player = getPlugin().getPlayerStorage().queryForId(sender.getData().getId());
4444
} catch (SQLException e) {
45-
sender.sendMessage(Message.get("sender.error.exception").toString());
45+
Message.get("sender.error.exception").sendTo(sender);
4646
e.printStackTrace();
4747
return;
4848
}
4949

5050
PlayerPinData pin = plugin.getPlayerPinStorage().getValidPin(player);
5151

5252
if (pin == null) {
53-
sender.sendMessage(Message.get("sender.error.exception").toString());
53+
Message.get("sender.error.exception").sendTo(sender);
5454
return;
5555
}
5656

0 commit comments

Comments
 (0)