Skip to content

Commit 50fee32

Browse files
author
NEZNAMY
committed
[Velocity] Bump minimum required Velocity build to 546 (after the bossbar bug was partially fixed) to avoid my head exploding when trying to fix the issue in TAB (and having to make it support the older versions as well) (#1610)
1 parent 39334a4 commit 50fee32

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityEventListener.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import me.neznamy.tab.shared.platform.EventListener;
1414
import me.neznamy.tab.shared.platform.TabPlayer;
1515
import me.neznamy.tab.shared.platform.decorators.SafeBossBar;
16-
import me.neznamy.tab.shared.util.ReflectionUtils;
1716
import org.jetbrains.annotations.NotNull;
1817

1918
import java.util.Map;
@@ -25,15 +24,6 @@
2524
*/
2625
public class VelocityEventListener implements EventListener<Player> {
2726

28-
/**
29-
* Whether plugin should be compensating for bossbar bug that was fixed in build #546 or not.
30-
* Compensating on builds #546+ will duplicate bossbars on server switch.
31-
* Not compensating on builds #545- will cause player disconnects on 1.20.5+ clients on server switch.
32-
* Not going to bump minimum required version just for this, we will wait for another opportunity to bump minimum build and then remove this.
33-
* EDIT: Apparently there is one more bug, so this option does not control as much, because code is executed regardless.
34-
*/
35-
private static final boolean BOSSBAR_BUG_COMPENSATION = !ReflectionUtils.classExists("com.velocitypowered.proxy.connection.player.bossbar.BossBarManager");
36-
3727
/** Map for tracking online players */
3828
private final Map<Player, UUID> players = new ConcurrentHashMap<>();
3929

@@ -94,7 +84,7 @@ public void onConnect(@NotNull ServerPostConnectEvent e) {
9484
);
9585
tab.getFeatureManager().onTabListClear(player);
9686
if (player.getVersionId() >= ProtocolVersion.V1_20_2.getNetworkId()) {
97-
((SafeBossBar<?>)player.getBossBar()).unfreezeAndResend(!BOSSBAR_BUG_COMPENSATION);
87+
((SafeBossBar<?>)player.getBossBar()).unfreezeAndResend(true);
9888
}
9989
}
10090
});

velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTAB.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import com.velocitypowered.api.plugin.Plugin;
99
import com.velocitypowered.api.plugin.annotation.DataDirectory;
1010
import com.velocitypowered.api.proxy.ProxyServer;
11-
import com.velocitypowered.api.proxy.player.TabListEntry;
1211
import lombok.Getter;
1312
import me.neznamy.tab.shared.ProjectVariables;
1413
import me.neznamy.tab.shared.TAB;
14+
import me.neznamy.tab.shared.util.ReflectionUtils;
1515
import org.bstats.velocity.Metrics;
1616
import org.jetbrains.annotations.Nullable;
1717
import org.slf4j.Logger;
@@ -53,13 +53,12 @@ public class VelocityTAB {
5353
*/
5454
@Subscribe
5555
public void onProxyInitialization(@Nullable ProxyInitializeEvent event) {
56-
try {
57-
TabListEntry.class.getMethod("setShowHat", boolean.class);
56+
if (ReflectionUtils.classExists("com.velocitypowered.proxy.connection.player.bossbar.BossBarManager")) {
5857
TAB.create(new VelocityPlatform(this));
59-
} catch (ReflectiveOperationException e) {
60-
logger.warn("====================================================================================================");
61-
logger.warn("The plugin requires Velocity build #485 (released on March 30th, 2025) and up to work.");
62-
logger.warn("====================================================================================================");
58+
} else {
59+
logger.error("====================================================================================================");
60+
logger.error("The plugin requires Velocity build #546 (released on October 17th, 2025) and up to work.");
61+
logger.error("====================================================================================================");
6362
}
6463
}
6564

0 commit comments

Comments
 (0)