Package net.minecraft.network.packet

Examples of net.minecraft.network.packet.Packet250CustomPayload


    catch (IOException e)
    {
      e.printStackTrace();
    }

    Packet250CustomPayload packet = new Packet250CustomPayload();
    packet.channel = channel;
    packet.data = bytes.toByteArray();
    packet.length = packet.data.length;

    return packet;
View Full Code Here


  public static void sendItemToServer(NetClientHandler sendQueue, byte slotID, ItemStack item) {
    if( sendQueue == null )
      return;

    try {
      Packet250CustomPayload packet = new CustomPacket( (byte) 0x03 ).add( slotID, item ).toPacket();
      sendQueue.addToSendQueue( packet );
    } catch ( IOException ioe ) {
      Utils.logException( "ICG-Custom Packet: Sending item to server. (0x03)", ioe, false );
    }
  }
View Full Code Here

    }
    return this;
  }

  public Packet250CustomPayload toPacket() {
    Packet250CustomPayload packet = new Packet250CustomPayload();
    packet.channel = "xact_channel";
    packet.data = byteArray.toByteArray();
    packet.length = packet.data.length;
    return packet;
  }
View Full Code Here

            outputStream.writeInt(randomInt2);
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        Packet250CustomPayload packet = new Packet250CustomPayload();
        packet.channel = "XPdec";
        packet.data = bos.toByteArray();
        packet.length = bos.size();

        Side side = FMLCommonHandler.instance().getEffectiveSide();
View Full Code Here

    {
      FMLLog.getLogger().info(Info.TITLE_LOG + "Client failed to create packet. (Details: " + e.toString() + ")");
      return;
    }

    AdvancedPowerManagement.proxy.sendPacketToServer(new Packet250CustomPayload(Info.PACKET_CHANNEL, bytes.toByteArray()));
  }
View Full Code Here

    catch (IOException e)
    {
      FMLLog.getLogger().info(Info.TITLE_LOG + "Server failed to create description packet. (Details: " + e.toString() + ")");
    }

    Packet250CustomPayload packet = new Packet250CustomPayload(Info.PACKET_CHANNEL, bytes.toByteArray());
    packet.isChunkDataPacket = true;
    return packet;
  }
View Full Code Here

      return;
    }
    String id;
    int size;
    if (packet instanceof Packet250CustomPayload) {
      Packet250CustomPayload packet250CustomPayload = (Packet250CustomPayload) packet;
      byte[] data = packet250CustomPayload.data;
      size = data == null ? 0 : data.length;
      id = packet250CustomPayload.channel + (size > 0 ? Byte.toString(data[0]) : Byte.MIN_VALUE);
    } else {
      id = String.valueOf(packet.getPacketId());
View Full Code Here

TOP

Related Classes of net.minecraft.network.packet.Packet250CustomPayload

Copyright © 2018 www.massapicom. 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.