@ -38,5 +38,5 @@ dependencies {
|
|||||||
|
|
||||||
compileOnly 'net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT'
|
compileOnly 'net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT'
|
||||||
compileOnly 'net.md-5:bungeecord-proxy:1.20-R0.3-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;
|
if (!ConfigSystem.isEnabled()) return;
|
||||||
|
|
||||||
String address = preLoginEvent.getConnection().getSocketAddress().toString();
|
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();
|
InitialHandler initialHandler = (InitialHandler) preLoginEvent.getConnection();
|
||||||
String extraData = initialHandler.getExtraDataInHandshake();
|
String extraData = initialHandler.getExtraDataInHandshake();
|
||||||
String[] split = extraData.split("\0");
|
String[] split = extraData.split("\0");
|
||||||
|
|||||||
@ -19,18 +19,25 @@
|
|||||||
|
|
||||||
package de.steamwar.utils;
|
package de.steamwar.utils;
|
||||||
|
|
||||||
import codecrafter47.bungeetablistplus.api.bungee.BungeeTabListPlusAPI;
|
|
||||||
import de.codecrafter47.taboverlay.TabView;
|
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class BungeeTabListPlusFixer {
|
public class BungeeTabListPlusFixer {
|
||||||
|
|
||||||
public static void remove(ProxiedPlayer player) {
|
public static void remove(ProxiedPlayer player) {
|
||||||
TabView tabView = BungeeTabListPlusAPI.getTabViewForPlayer(player);
|
try {
|
||||||
if (tabView != null) {
|
Class clazz = Class.forName("codecrafter47.bungeetablistplus.api.bungee.BungeeTabListPlusAPI");
|
||||||
tabView.deactivate();
|
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