Package packets.c2spackets

Source Code of packets.c2spackets.P0x6B

package packets.c2spackets;

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

/**
* Creative Inventory Action.
* Setting an item in the players creative inventory.
* @author remco_lw
*
*/
public class P0x6B extends PacketHandler {

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

  @Override
  public void handle(MCConnection conn) throws UnrecoverableException {
    short slot = conn.r.readShort();
    MCItemSlot slotcontent = MCItemSlot.readFromSocket(conn.r);
   
    if(slot >= 36) {
      slot -= 36;
      conn.getPlayer().setSlotItem(slot, slotcontent);
    } else {
      //TODO
    }
  }

}
TOP

Related Classes of packets.c2spackets.P0x6B

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.