|
8 | 8 | import com.velocitypowered.api.plugin.Plugin; |
9 | 9 | import com.velocitypowered.api.plugin.annotation.DataDirectory; |
10 | 10 | import com.velocitypowered.api.proxy.ProxyServer; |
11 | | -import com.velocitypowered.api.proxy.player.TabListEntry; |
12 | 11 | import lombok.Getter; |
13 | 12 | import me.neznamy.tab.shared.ProjectVariables; |
14 | 13 | import me.neznamy.tab.shared.TAB; |
| 14 | +import me.neznamy.tab.shared.util.ReflectionUtils; |
15 | 15 | import org.bstats.velocity.Metrics; |
16 | 16 | import org.jetbrains.annotations.Nullable; |
17 | 17 | import org.slf4j.Logger; |
@@ -53,13 +53,12 @@ public class VelocityTAB { |
53 | 53 | */ |
54 | 54 | @Subscribe |
55 | 55 | 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")) { |
58 | 57 | 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("===================================================================================================="); |
63 | 62 | } |
64 | 63 | } |
65 | 64 |
|
|
0 commit comments