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

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

There is a newer version: 2.4.0
Show newest version
package net.minecraft.server;

import java.io.IOException;

public class PacketPlayOutChat implements Packet {

  public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
  private IChatBaseComponent a;
  private byte b;

  public PacketPlayOutChat() {
  }

  public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent) {
    this(ichatbasecomponent, (byte) 1);
  }

  public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, byte b0) {
    this.a = ichatbasecomponent;
    this.b = b0;
  }

  public void a(PacketDataSerializer packetdataserializer) throws IOException {
    this.a = packetdataserializer.d();
    this.b = packetdataserializer.readByte();
  }

  public void b(PacketDataSerializer packetdataserializer) throws IOException {
    // Spigot start
    if (components != null) {
      packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(components));
    } else {
      packetdataserializer.a(this.a);
    }
    // Spigot end
    packetdataserializer.writeByte(this.b);
  }

  public void a(PacketListenerPlayOut packetlistenerplayout) {
    packetlistenerplayout.a(this);
  }

  public boolean b() {
    return this.b == 1 || this.b == 2;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy