diff --git a/velocity/build.gradle.kts b/velocity/build.gradle.kts index d6029d461..ecb46c5e6 100644 --- a/velocity/build.gradle.kts +++ b/velocity/build.gradle.kts @@ -2,12 +2,12 @@ dependencies { implementation(projects.shared) implementation("org.bstats:bstats-velocity:3.1.0") compileOnly("com.github.limework.redisbungee:RedisBungee-Velocity:0.11.0") - compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT") - annotationProcessor("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT") + compileOnly("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT") + annotationProcessor("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT") compileOnly("com.github.LeonMangler:PremiumVanishAPI:2.9.0-4") compileOnly("net.william278:velocityscoreboardapi:1.0.1") } tasks.compileJava { - options.release.set(11) + options.release.set(17) } \ No newline at end of file diff --git a/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityPlatform.java b/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityPlatform.java index 35feaea6a..1fe0a182d 100644 --- a/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityPlatform.java +++ b/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityPlatform.java @@ -186,7 +186,7 @@ public boolean supportsNumberFormat() { @Override public boolean supportsListOrder() { - return false; // TODO when they add API + return true; } @Override diff --git a/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTAB.java b/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTAB.java index e4f3c1b1e..24cc51e33 100644 --- a/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTAB.java +++ b/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTAB.java @@ -8,10 +8,10 @@ import com.velocitypowered.api.plugin.Plugin; import com.velocitypowered.api.plugin.annotation.DataDirectory; import com.velocitypowered.api.proxy.ProxyServer; +import com.velocitypowered.api.proxy.player.TabListEntry; import lombok.Getter; import me.neznamy.tab.shared.TAB; import me.neznamy.tab.shared.TabConstants; -import me.neznamy.tab.shared.chat.EnumChatFormat; import me.neznamy.tab.shared.util.ReflectionUtils; import org.bstats.velocity.Metrics; import org.jetbrains.annotations.Nullable; @@ -54,8 +54,8 @@ public class VelocityTAB { */ @Subscribe public void onProxyInitialization(@Nullable ProxyInitializeEvent event) { - if (!ReflectionUtils.classExists("net.kyori.adventure.text.logger.slf4j.ComponentLogger")) { - logger.warn(EnumChatFormat.RED + "The plugin requires Velocity build #274 (released on October 12th, 2023) and up to work."); + if (!ReflectionUtils.methodExists(TabListEntry.class, "setListOrder", int.class)) { + logger.warn("The plugin requires Velocity build #450 (released on November 10th, 2024) and up to work."); return; } TAB.create(new VelocityPlatform(this)); diff --git a/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTabList.java b/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTabList.java index c391a4e8e..43b0ba340 100644 --- a/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTabList.java +++ b/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTabList.java @@ -55,7 +55,7 @@ public void updateListed(@NonNull UUID entry, boolean listed) { @Override public void updateListOrder(@NonNull UUID entry, int listOrder) { - // TODO once velocity adds it + player.getPlayer().getTabList().getEntry(entry).ifPresent(e -> e.setListOrder(listOrder)); } @Override @@ -75,8 +75,8 @@ public void addEntry(@NonNull UUID id, @NonNull String name, @Nullable Skin skin .latency(latency) .gameMode(gameMode) .listed(listed) + .listOrder(listOrder) .build(); - // TODO listOrder once velocity adds it // TODO showHat once velocity adds it // Remove entry because: