Package packets.c2spackets

Source Code of packets.c2spackets.P0x0D

package packets.c2spackets;

import network.MCConnection;
import entities.Player;
import exceptions.UnrecoverableException;
import packets.PacketHandler;
import world.WorldState;

public class P0x0D extends PacketHandler {

  public P0x0D(WorldState state) {
    super(state);
  }

  @Override
  public void handle(MCConnection conn) throws UnrecoverableException {
    double x = conn.r.readDouble();
    double y = conn.r.readDouble();
    double stance = conn.r.readDouble();
    double z = conn.r.readDouble();

    float yaw = conn.r.readFloat();
    float pitch = conn.r.readFloat();
    boolean onground = conn.r.readBoolean();
   
    Player p = conn.getPlayer();
    p.setLocation(x, y, z);
    p.setStance(stance);
    p.setYaw(yaw);
    p.setPitch(pitch);
    p.setOnGround(onground);
    p.updateLocation();
   
  }

}
TOP

Related Classes of packets.c2spackets.P0x0D

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.