Package packets.c2spackets

Source Code of packets.c2spackets.P0x12

package packets.c2spackets;

import datatypes.MCAnimation;
import network.MCConnection;
import exceptions.UnrecoverableException;
import packets.PacketHandler;
import world.WorldState;

/**
* Send when an entity performs an animation-action.
* The receiving of a packet updates it for the player.
*/
public class P0x12 extends PacketHandler {

  public P0x12(WorldState worldstate) {
    super(worldstate);
  }

  @Override
  public void handle(MCConnection conn) throws UnrecoverableException {
    /*int eid = */conn.r.readInt();
    MCAnimation animation = MCAnimation.getAnimation(conn.r.read());
   
    if(/*conn.getPlayer().geteid() == eid && */(animation == MCAnimation.SWINGARM || animation == MCAnimation.LEAVE_BED)) {
      conn.getPlayer().setAnimation(animation);
    }/* else {
      //TODO: HACKATTEMPT?
      conn.disconnect();
    }*/
   
  }
TOP

Related Classes of packets.c2spackets.P0x12

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.