Package packets.s2cpackets

Source Code of packets.s2cpackets.S0x14

package packets.s2cpackets;

import datatypes.MCItemSlot;
import entities.Player;
import exceptions.UnrecoverableException;
import packets.SPacket;

public class S0x14 extends SPacket {
  public S0x14(Player player) {
    super(0x14);
   
    addInt(player.geteid());        //EID
    addString(player.getName());      //Name
    addInt(player.getLastLocation().x)//X as abs int
    addInt(player.getLastLocation().y)//Y as abs int
    addInt(player.getLastLocation().z)//Z as abs int
    add((byte) player.getYaw());      // Rotation
    add((byte) player.getPitch());    // Pitch
   
    short selecteditem = 0;
    try {
      MCItemSlot currentitem = player.getHeldItemAtSlot(player.getSelectedSlot());
      selecteditem = currentitem.getItem().getItemId();
    } catch (UnrecoverableException e) {
      e.printStackTrace();
    } catch (NullPointerException e) {}
   
    addShort(selecteditem);    // Current item
  }
}
TOP

Related Classes of packets.s2cpackets.S0x14

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.