Package packets.c2spackets

Source Code of packets.c2spackets.P0x0B

package packets.c2spackets;

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

/**
* 0x0B: Player Position
*
*
*/
public class P0x0B extends PacketHandler {

  public P0x0B(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();
    boolean onground = conn.r.readBoolean();
   
    Player p = conn.getPlayer();
    p.setLocation(x, y, z);
    p.setStance(stance);
    p.setOnGround(onground);
    p.updateLocation(); //TODO: UpdateLocationOnly
  }

}
TOP

Related Classes of packets.c2spackets.P0x0B

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.