From 4365a573f53dcb84a2528556438398c5f46ad831 Mon Sep 17 00:00:00 2001 From: RegadPoleCN Date: Sun, 2 Aug 2026 23:32:40 +0800 Subject: [PATCH 1/3] feat: update gradle version --- gradle/wrapper/gradle-wrapper.properties | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..59d1379 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,6 @@ +#Sun Aug 02 23:14:39 CST 2026 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +distributionUrl=https\://mirrors.aliyun.com/gradle/distributions/v9.3.0/gradle-9.3.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From f57e0221ac7edee4f036d0e09c4746cd532dc121 Mon Sep 17 00:00:00 2001 From: RegadPoleCN Date: Sun, 2 Aug 2026 23:33:16 +0800 Subject: [PATCH 2/3] feat: support AuthMeVelocity plugin --- build.gradle | 21 +++++++------- .../VelocityBridgeBehavior.java | 7 ++--- .../easyBotVelocity/utils/AuthMeVcUtils.java | 29 +++++++++++++++++++ 3 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 src/main/java/org/lby123165/easyBotVelocity/utils/AuthMeVcUtils.java diff --git a/build.gradle b/build.gradle index bf75586..e2e9b0f 100644 --- a/build.gradle +++ b/build.gradle @@ -17,12 +17,12 @@ repositories { url = "https://repo.papermc.io/repository/maven-public/" } maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/easybot-team/easybot-bridge") - credentials { - username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("gpr.user") - password = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.key") - } + name = "Jitpack" + url = "https://www.jitpack.io" + } + maven { + name = "GeyserMC" + url = "https://repo.opencollab.dev/main/" } } @@ -30,12 +30,13 @@ dependencies { compileOnly("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT") annotationProcessor("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT") - implementation('com.springwater.easybot:easybot-bridge:1.7.1') { + implementation('com.github.easybot-team:easybot-bridge:1.7.1') { exclude group: 'com.google.code.gson', module: 'gson' exclude group: 'org.slf4j', module: 'slf4j-api' exclude group: 'org.projectlombok', module: 'lombok' } - + + compileOnly("io.github.4drian3d:authmevelocity-api-velocity:4.3.0") compileOnly(fileTree('libs')) implementation 'org.java-websocket:Java-WebSocket:1.5.3' @@ -61,9 +62,9 @@ tasks { } } -def targetJavaVersion = 17 +def targetJavaVersion = 25 java { - toolchain.languageVersion = JavaLanguageVersion.of(22) + toolchain.languageVersion = JavaLanguageVersion.of(25) } tasks.withType(JavaCompile).configureEach { diff --git a/src/main/java/org/lby123165/easyBotVelocity/VelocityBridgeBehavior.java b/src/main/java/org/lby123165/easyBotVelocity/VelocityBridgeBehavior.java index e3b6e1d..da2a44e 100644 --- a/src/main/java/org/lby123165/easyBotVelocity/VelocityBridgeBehavior.java +++ b/src/main/java/org/lby123165/easyBotVelocity/VelocityBridgeBehavior.java @@ -2,18 +2,14 @@ import com.springwater.easybot.bridge.BridgeBehavior; import com.springwater.easybot.bridge.message.Segment; -import com.springwater.easybot.bridge.message.TextSegment; import com.springwater.easybot.bridge.model.PlayerInfo; import com.springwater.easybot.bridge.model.ServerInfo; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ProxyServer; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.ComponentBuilder; import net.kyori.adventure.text.TextComponent; -import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.lby123165.easyBotVelocity.sender.EasyBotCommandSender; import org.lby123165.easyBotVelocity.utils.*; -import org.slf4j.Logger; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -109,6 +105,9 @@ public boolean isAuthenticated(String playerName) { if (LibreLoginUtils.hasLiberLogin()) { return LibreLoginUtils.isAuthenticated(player.get()); } + if (AuthMeVcUtils.hasAuthMeVelocity()) { + return AuthMeVcUtils.isAuthenticated(player.get()); + } return true; } diff --git a/src/main/java/org/lby123165/easyBotVelocity/utils/AuthMeVcUtils.java b/src/main/java/org/lby123165/easyBotVelocity/utils/AuthMeVcUtils.java new file mode 100644 index 0000000..c5d7748 --- /dev/null +++ b/src/main/java/org/lby123165/easyBotVelocity/utils/AuthMeVcUtils.java @@ -0,0 +1,29 @@ +package org.lby123165.easyBotVelocity.utils; + +import com.velocitypowered.api.proxy.Player; +import io.github._4drian3d.authmevelocity.api.velocity.AuthMeVelocityAPI; +import org.jetbrains.annotations.Nullable; +import org.lby123165.easyBotVelocity.EasyBotVelocity; + +public class AuthMeVcUtils { + private static @Nullable AuthMeVelocityAPI authMeVelocityAPI = null; + + public static boolean hasAuthMeVelocity() { + return EasyBotVelocity.getInstance().getServer().getPluginManager().isLoaded("authmevelocity"); + } + + public static AuthMeVelocityAPI getAuthMeVelocityAPI() { + if (authMeVelocityAPI == null) { + authMeVelocityAPI = (AuthMeVelocityAPI) EasyBotVelocity.getInstance().getServer().getPluginManager().getPlugin("authmevelocity").orElseThrow().getInstance().orElseThrow(); + } + return authMeVelocityAPI; + } + + @SuppressWarnings("unchecked") + public static boolean isAuthenticated(Player proxyPlayer) { + if (!hasAuthMeVelocity()) { + return true; + } + return getAuthMeVelocityAPI().isLogged(proxyPlayer); + } +} From fbc8ffdd24a3f40a71605d5c02e025895d523049 Mon Sep 17 00:00:00 2001 From: zzh4141 Date: Mon, 3 Aug 2026 08:46:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E5=A3=B0=E6=98=8Eauthmevelocity?= =?UTF-8?q?=E8=BD=AF=E4=BE=9D=E8=B5=96,=20shadow=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E8=87=B39.6.1,=20Java=2021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- build.gradle | 10 +++++----- .../org/lby123165/easyBotVelocity/EasyBotVelocity.java | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a7c31d..4aedf09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up JDK 22 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '22' + java-version: '21' distribution: 'temurin' cache: gradle diff --git a/build.gradle b/build.gradle index e2e9b0f..da513e9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ plugins { id 'java' id 'eclipse' - id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.8' - id("xyz.jpenilla.run-velocity") version "2.3.1" + id 'org.jetbrains.gradle.plugin.idea-ext' version '1.4.1' + id("xyz.jpenilla.run-velocity") version "3.0.2" - id 'com.github.johnrengelman.shadow' version '8.1.1' + id 'com.gradleup.shadow' version '9.6.1' } group = 'org.lby123165' @@ -62,9 +62,9 @@ tasks { } } -def targetJavaVersion = 25 +def targetJavaVersion = 21 java { - toolchain.languageVersion = JavaLanguageVersion.of(25) + toolchain.languageVersion = JavaLanguageVersion.of(21) } tasks.withType(JavaCompile).configureEach { diff --git a/src/main/java/org/lby123165/easyBotVelocity/EasyBotVelocity.java b/src/main/java/org/lby123165/easyBotVelocity/EasyBotVelocity.java index 07edd44..f531af8 100644 --- a/src/main/java/org/lby123165/easyBotVelocity/EasyBotVelocity.java +++ b/src/main/java/org/lby123165/easyBotVelocity/EasyBotVelocity.java @@ -24,7 +24,8 @@ authors = {"lby123165", "MiuxuE"}, dependencies = { @Dependency(id = "librelogin", optional = true), - @Dependency(id = "limboauth", optional = true) + @Dependency(id = "limboauth", optional = true), + @Dependency(id = "authmevelocity", optional = true) } )