3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 06:50:08 +01:00
Dieser Commit ist enthalten in:
Myles 2016-12-20 20:13:19 +00:00
Ursprung 08b2d5b7e8
Commit 3228ba65ae

Datei anzeigen

@ -29,16 +29,20 @@ public class MainHandPatch implements Listener {
@EventHandler
public void onServerConnect(ServerConnectEvent event) {
// Ignore if it doesn't exist (Like BungeeCord 1.8)
if (setMainHand == null)
if (setMainHand == null || getSettings == null)
return;
UserConnection user = Via.getManager().getConnection(event.getPlayer().getUniqueId());
if(user == null) return;
if (user == null) return;
try {
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9TO1_8.class)) {
Object settings = getSettings.invoke(event.getPlayer());
setMainHand.invoke(settings, user.get(EntityTracker.class).getMainHand());
if (settings != null) {
if (user.has(EntityTracker.class)) {
setMainHand.invoke(settings, user.get(EntityTracker.class).getMainHand());
}
}
}
} catch (Exception e) {
e.printStackTrace();