3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-10-03 08:41:05 +02:00

Ignore if the setMainHand doesn't exist

Dieser Commit ist enthalten in:
Matsv 2016-11-14 21:13:18 +01:00
Ursprung 9b7f68a888
Commit d277701caa

Datei anzeigen

@ -22,13 +22,16 @@ public class MainHandPatch implements Listener {
try {
getSettings = Class.forName("net.md_5.bungee.UserConnection").getDeclaredMethod("getSettings");
setMainHand = Class.forName("net.md_5.bungee.protocol.packet.ClientSettings").getDeclaredMethod("setMainHand", int.class);
} catch (NoSuchMethodException | ClassNotFoundException e) {
e.printStackTrace();
} catch (Exception ignored) {
}
}
@EventHandler
public void onServerConnect(ServerConnectEvent event) {
// Ignore if it doesn't exist (Like BungeeCord 1.8)
if (setMainHand == null)
return;
UserConnection user = Via.getManager().getConnection(event.getPlayer().getUniqueId());
try {