All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.PacketHandshakingInSetProtocol Maven / Gradle / Ivy

package net.minecraft.server;

import java.io.IOException;

public class PacketHandshakingInSetProtocol implements Packet {

  public String hostname;
  public int port;
  private int a;
  private EnumProtocol d;

  public PacketHandshakingInSetProtocol() {
  }

  public void a(PacketDataSerializer packetdataserializer) throws IOException {
    this.a = packetdataserializer.e();
    this.hostname = packetdataserializer.c(Short.MAX_VALUE); // Spigot
    this.port = packetdataserializer.readUnsignedShort();
    this.d = EnumProtocol.a(packetdataserializer.e());
  }

  public void b(PacketDataSerializer packetdataserializer) throws IOException {
    packetdataserializer.b(this.a);
    packetdataserializer.a(this.hostname);
    packetdataserializer.writeShort(this.port);
    packetdataserializer.b(this.d.a());
  }

  public void a(PacketHandshakingInListener packethandshakinginlistener) {
    packethandshakinginlistener.a(this);
  }

  public EnumProtocol a() {
    return this.d;
  }

  public int b() {
    return this.a;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy