From e9d59553387da87170aa3c96ac2c9b47529d08e7 Mon Sep 17 00:00:00 2001
From: TechnicJelle <22576047+TechnicJelle@users.noreply.github.com>
Date: Sun, 2 Feb 2025 21:05:39 +0100
Subject: [PATCH] Update dependencies & bump version
---
.github/workflows/main.yml | 25 +++++++++++++
pom.xml | 36 +++++++++++--------
.../bluemapplayercontrol/commands/BMPC.java | 7 ++--
3 files changed, 49 insertions(+), 19 deletions(-)
create mode 100644 .github/workflows/main.yml
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..c8101c1
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,25 @@
+name: Java CI with Maven
+
+on:
+ push:
+ pull_request:
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: '21'
+ distribution: 'temurin'
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+ - name: Upload a Build Artifact
+ uses: actions/upload-artifact@v4
+ with:
+ path: |
+ target/*.jar
+ !target/original-*.jar
diff --git a/pom.xml b/pom.xml
index 59ee5c5..b19f483 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,13 +6,13 @@
com.technicjelle
BlueMapPlayerControl
- 1.5
+ 1.6
jar
BlueMapPlayerControl
- 11
+ 21
UTF-8
@@ -21,7 +21,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.13.0
${java.version}
${java.version}
@@ -30,12 +30,16 @@
org.apache.maven.plugins
maven-shade-plugin
- 3.2.4
+ 3.6.0
+
+ com.technicjelle.UpdateChecker
+ com.technicjelle.bluemapplayercontrol.shadow.UpdateChecker
+
org.bstats
- com.technicjelle.bluemapplayercontrol
+ com.technicjelle.bluemapplayercontrol.shadow.bstats
@@ -62,7 +66,7 @@
- papermc-repo
+ papermc
https://repo.papermc.io/repository/maven-public/
@@ -70,16 +74,18 @@
https://oss.sonatype.org/content/groups/public/
- jitpack.io
- https://jitpack.io
+ bluecolored-releases
+ BlueColored Repository
+ https://repo.bluecolored.de/releases
- com.github.TechnicJelle
- UpdateCheckerJava
- v2.3
+ com.technicjelle
+ UpdateChecker
+ 2.5.1
+ compile
com.destroystokyo.paper
@@ -88,9 +94,9 @@
provided
- com.github.BlueMap-Minecraft
- BlueMapAPI
- v2.6.1
+ de.bluecolored
+ bluemap-api
+ 2.7.3
provided
@@ -102,7 +108,7 @@
org.bstats
bstats-bukkit
- 3.0.2
+ 3.1.0
compile
diff --git a/src/main/java/com/technicjelle/bluemapplayercontrol/commands/BMPC.java b/src/main/java/com/technicjelle/bluemapplayercontrol/commands/BMPC.java
index 5fd8f6a..8dcc714 100644
--- a/src/main/java/com/technicjelle/bluemapplayercontrol/commands/BMPC.java
+++ b/src/main/java/com/technicjelle/bluemapplayercontrol/commands/BMPC.java
@@ -15,6 +15,7 @@
import java.util.List;
import java.util.UUID;
+@SuppressWarnings("UnstableApiUsage")
public class BMPC implements CommandExecutor, TabCompleter {
public BMPC() {
@@ -26,8 +27,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
BlueMapAPI api = BlueMapAPI.getInstance().get();
// === SELF ===
- if (sender instanceof Player) { // only players can self
- Player player = (Player) sender;
+ if (sender instanceof Player player) { // only players can self
UUID senderUUID = player.getUniqueId();
if (args.length == 0) {
//toggle
@@ -65,8 +65,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
return true;
}
for (Entity target : targets) {
- if (!(target instanceof Player)) continue;
- Player targetPlayer = (Player) target;
+ if (!(target instanceof Player targetPlayer)) continue;
if (args.length == 1) {
//toggle
if (api.getWebApp().getPlayerVisibility(targetPlayer.getUniqueId())) {