Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +01:00
Ignore if the setMainHand doesn't exist
Dieser Commit ist enthalten in:
Ursprung
9b7f68a888
Commit
d277701caa
@ -22,13 +22,16 @@ public class MainHandPatch implements Listener {
|
|||||||
try {
|
try {
|
||||||
getSettings = Class.forName("net.md_5.bungee.UserConnection").getDeclaredMethod("getSettings");
|
getSettings = Class.forName("net.md_5.bungee.UserConnection").getDeclaredMethod("getSettings");
|
||||||
setMainHand = Class.forName("net.md_5.bungee.protocol.packet.ClientSettings").getDeclaredMethod("setMainHand", int.class);
|
setMainHand = Class.forName("net.md_5.bungee.protocol.packet.ClientSettings").getDeclaredMethod("setMainHand", int.class);
|
||||||
} catch (NoSuchMethodException | ClassNotFoundException e) {
|
} catch (Exception ignored) {
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onServerConnect(ServerConnectEvent event) {
|
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());
|
UserConnection user = Via.getManager().getConnection(event.getPlayer().getUniqueId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren