Fix a NPE bug when joining

Sometimes AntiForceLook tried to adjust packets using a nonexistant player while joining.
This commit is contained in:
Ridan Vandenbergh 2019-11-21 23:57:12 +01:00
parent 174297962d
commit d6f789f305
1 changed files with 1 additions and 0 deletions

View File

@ -14,6 +14,7 @@ public class AntiForceLook extends Module {
@EventHandler
Listener<PacketEvent.Receive> receiveListener = new Listener<>(event -> {
if (mc.player == null) return;
if (event.getPacket() instanceof SPacketPlayerPosLook) {
SPacketPlayerPosLook packet = (SPacketPlayerPosLook) event.getPacket();
packet.yaw = mc.player.rotationYaw;