From 4cf5f6154a146aef194854f84904a00d74af3218 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:20:45 +0100 Subject: [PATCH] Remove indra --- buildSrc/build.gradle.kts | 12 ++- .../kotlin/pq.java-conventions.gradle.kts | 77 ++++++++++--------- .../pistonqueue/bukkit/ServerListener.java | 6 +- .../pistonqueue/bungee/PistonQueueBungee.java | 2 +- 4 files changed, 55 insertions(+), 42 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 5551e3d..f149353 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -4,10 +4,18 @@ plugins { repositories { gradlePluginPortal() - mavenCentral() } dependencies { implementation("com.gradleup.shadow:shadow-gradle-plugin:9.0.0-beta4") - implementation("net.kyori:indra-common:3.1.3") +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} + +kotlin { + jvmToolchain(17) } diff --git a/buildSrc/src/main/kotlin/pq.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/pq.java-conventions.gradle.kts index 8ecc041..c27d6a0 100644 --- a/buildSrc/src/main/kotlin/pq.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/pq.java-conventions.gradle.kts @@ -1,8 +1,6 @@ plugins { `java-library` `maven-publish` - id("net.kyori.indra") - id("net.kyori.indra.publishing") } java { @@ -29,41 +27,6 @@ tasks.withType { options.compilerArgs.add("-Xlint:all,-serial,-processing") } -indra { - github("AlexProgrammerDE", "PistonQueue") { - ci(true) - } - - gpl3OnlyLicense() - publishReleasesTo("codemc-releases", "https://repo.codemc.org/repository/maven-releases/") - publishSnapshotsTo("codemc-snapshots", "https://repo.codemc.org/repository/maven-snapshots/") - - configurePublications { - pom { - name.set("PistonQueue") - url.set("https://pistonmaster.net/PistonQueue") - organization { - name.set("AlexProgrammerDE") - url.set("https://pistonmaster.net") - } - developers { - developer { - id.set("AlexProgrammerDE") - timezone.set("Europe/Berlin") - url.set("https://pistonmaster.net") - } - } - } - } - - javaVersions { - target(21) - strictVersions() - testWith(21) - minimumToolchain(21) - } -} - val repoName = if (version.toString().endsWith("SNAPSHOT")) "maven-snapshots" else "maven-releases" publishing { repositories { @@ -73,4 +36,44 @@ publishing { name = "codemc" } } + publications { + register("mavenJava") { + from(components["java"]) + pom { + name = "PistonQueue" + description = rootProject.description + url = "https://github.com/AlexProgrammerDE/PistonQueue" + organization { + name = "AlexProgrammerDE" + url = "https://pistonmaster.net" + } + developers { + developer { + id = "AlexProgrammerDE" + timezone = "Europe/Berlin" + url = "https://pistonmaster.net" + } + } + licenses { + license { + name = "GNU General Public License v3.0" + url = "https://www.gnu.org/licenses/gpl-3.0.html" + } + } + scm { + connection = "scm:git:https://github.com/AlexProgrammerDE/PistonQueue.git" + developerConnection = "scm:git:ssh://git@github.com/AlexProgrammerDE/PistonQueue.git" + url = "https://github.com/AlexProgrammerDE/PistonQueue" + } + ciManagement { + system = "GitHub Actions" + url = "https://github.com/AlexProgrammerDE/PistonQueue/actions" + } + issueManagement { + system = "GitHub" + url = "https://github.com/AlexProgrammerDE/PistonQueue/issues" + } + } + } + } } diff --git a/bukkit/src/main/java/net/pistonmaster/pistonqueue/bukkit/ServerListener.java b/bukkit/src/main/java/net/pistonmaster/pistonqueue/bukkit/ServerListener.java index da6be2e..16258a8 100644 --- a/bukkit/src/main/java/net/pistonmaster/pistonqueue/bukkit/ServerListener.java +++ b/bukkit/src/main/java/net/pistonmaster/pistonqueue/bukkit/ServerListener.java @@ -34,6 +34,7 @@ import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.player.*; import org.bukkit.scoreboard.Scoreboard; +import org.bukkit.scoreboard.ScoreboardManager; import org.bukkit.scoreboard.Team; import java.util.Objects; @@ -67,8 +68,9 @@ public void onPlayerJoin(PlayerJoinEvent event) { }); } - if (plugin.isTeam()) { - Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard(); + ScoreboardManager manager = Bukkit.getScoreboardManager(); + if (plugin.isTeam() && manager != null) { + Scoreboard scoreboard = manager.getNewScoreboard(); Team team = scoreboard.registerNewTeam(plugin.getTeamName() .replace("%player_name%", player.getName()) diff --git a/bungee/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java b/bungee/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java index fc98bec..454e16c 100644 --- a/bungee/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java +++ b/bungee/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java @@ -46,8 +46,8 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; +@Getter public final class PistonQueueBungee extends Plugin implements PistonQueuePlugin { - @Getter private final QueueListenerBungee queueListenerBungee = new QueueListenerBungee(this); @Override