![JAR search and dependency download from the Maven repository](/logo.png)
cn.nukkit.network.protocol.SetTitlePacket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.network.protocol;
import lombok.ToString;
/**
* @author Tee7even
*/
@ToString
public class SetTitlePacket extends DataPacket {
public static final byte NETWORK_ID = ProtocolInfo.SET_TITLE_PACKET;
public static final int TYPE_CLEAR = 0;
public static final int TYPE_RESET = 1;
public static final int TYPE_TITLE = 2;
public static final int TYPE_SUBTITLE = 3;
public static final int TYPE_ACTION_BAR = 4;
public static final int TYPE_ANIMATION_TIMES = 5;
public int type;
public String text = "";
public int fadeInTime = 0;
public int stayTime = 0;
public int fadeOutTime = 0;
@Override
public byte pid() {
return NETWORK_ID;
}
@Override
public void decode() {
this.type = this.getVarInt();
this.text = this.getString();
this.fadeInTime = this.getVarInt();
this.stayTime = this.getVarInt();
this.fadeOutTime = this.getVarInt();
}
@Override
public void encode() {
this.reset();
this.putVarInt(type);
this.putString(text);
this.putVarInt(fadeInTime);
this.putVarInt(stayTime);
this.putVarInt(fadeOutTime);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy