Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8172bf50e1 |
@ -38,5 +38,5 @@ dependencies {
|
||||
|
||||
compileOnly 'net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT'
|
||||
compileOnly 'net.md-5:bungeecord-proxy:1.20-R0.3-SNAPSHOT'
|
||||
implementation 'codecrafter47.bungeetablistplus:bungeetablistplus-api-bungee:3.5.2'
|
||||
// implementation 'codecrafter47.bungeetablistplus:bungeetablistplus-api-bungee:3.5.2'
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ public class SteamwarConnectionListener implements Listener {
|
||||
if (!ConfigSystem.isEnabled()) return;
|
||||
|
||||
String address = preLoginEvent.getConnection().getSocketAddress().toString();
|
||||
if (address.startsWith("/78.31.71.136:")) {
|
||||
if (address.startsWith("/178.63.72.88:")) {
|
||||
InitialHandler initialHandler = (InitialHandler) preLoginEvent.getConnection();
|
||||
String extraData = initialHandler.getExtraDataInHandshake();
|
||||
String[] split = extraData.split("\0");
|
||||
|
||||
@ -19,18 +19,25 @@
|
||||
|
||||
package de.steamwar.utils;
|
||||
|
||||
import codecrafter47.bungeetablistplus.api.bungee.BungeeTabListPlusAPI;
|
||||
import de.codecrafter47.taboverlay.TabView;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@UtilityClass
|
||||
public class BungeeTabListPlusFixer {
|
||||
|
||||
public static void remove(ProxiedPlayer player) {
|
||||
TabView tabView = BungeeTabListPlusAPI.getTabViewForPlayer(player);
|
||||
if (tabView != null) {
|
||||
tabView.deactivate();
|
||||
try {
|
||||
Class clazz = Class.forName("codecrafter47.bungeetablistplus.api.bungee.BungeeTabListPlusAPI");
|
||||
Method getTabViewForPlayer = clazz.getMethod("getTabViewForPlayer", ProxiedPlayer.class);
|
||||
Object tabView = getTabViewForPlayer.invoke(null, player);
|
||||
if (tabView != null) {
|
||||
Method deactivate = getTabViewForPlayer.getReturnType().getMethod("deactivate");
|
||||
deactivate.invoke(tabView);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user