minecraft_25w45a_unobfuscated/net/minecraft/network/protocol/game/ClientboundSetTitlesAnimationPacket.java
2025-11-24 22:52:51 +03:00

61 lines
1.8 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.network.protocol.game;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketType;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.network.protocol.game.GamePacketTypes;
public class ClientboundSetTitlesAnimationPacket
implements Packet<ClientGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ClientboundSetTitlesAnimationPacket> STREAM_CODEC = Packet.codec(ClientboundSetTitlesAnimationPacket::write, ClientboundSetTitlesAnimationPacket::new);
private final int fadeIn;
private final int stay;
private final int fadeOut;
public ClientboundSetTitlesAnimationPacket(int fadeIn, int stay, int fadeOut) {
this.fadeIn = fadeIn;
this.stay = stay;
this.fadeOut = fadeOut;
}
private ClientboundSetTitlesAnimationPacket(FriendlyByteBuf input) {
this.fadeIn = input.readInt();
this.stay = input.readInt();
this.fadeOut = input.readInt();
}
private void write(FriendlyByteBuf output) {
output.writeInt(this.fadeIn);
output.writeInt(this.stay);
output.writeInt(this.fadeOut);
}
@Override
public PacketType<ClientboundSetTitlesAnimationPacket> type() {
return GamePacketTypes.CLIENTBOUND_SET_TITLES_ANIMATION;
}
@Override
public void handle(ClientGamePacketListener listener) {
listener.setTitlesAnimation(this);
}
public int getFadeIn() {
return this.fadeIn;
}
public int getStay() {
return this.stay;
}
public int getFadeOut() {
return this.fadeOut;
}
}