Package com.google.common.io

Examples of com.google.common.io.ByteArrayDataInput.readUnsignedByte()


  {
    try
    {
      EntityPlayer entityPlayer = (EntityPlayer) player;
      ByteArrayDataInput in = ByteStreams.newDataInput(packet.data);
      int packetId = in.readUnsignedByte(); // Assuming your packetId is between 0 (inclusive) and 256 (exclusive). If you need more you need to change this
      AbstractPacket ecPacket = AbstractPacket.constructPacket(packetId);
      ecPacket.read(in);
      ecPacket.execute(entityPlayer, entityPlayer.worldObj.isRemote ? Side.CLIENT : Side.SERVER);
    } catch (ProtocolException e)
    {
View Full Code Here

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.