30 lines
1.2 KiB
Java
30 lines
1.2 KiB
Java
|
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.util.debugchart.RemoteDebugSampleType;
|
||
|
|
||
|
public record ServerboundDebugSampleSubscriptionPacket(RemoteDebugSampleType sampleType) implements Packet<ServerGamePacketListener> {
|
||
|
public static final StreamCodec<FriendlyByteBuf, ServerboundDebugSampleSubscriptionPacket> STREAM_CODEC = Packet.codec(
|
||
|
ServerboundDebugSampleSubscriptionPacket::write, ServerboundDebugSampleSubscriptionPacket::new
|
||
|
);
|
||
|
|
||
|
private ServerboundDebugSampleSubscriptionPacket(FriendlyByteBuf p_329344_) {
|
||
|
this(p_329344_.readEnum(RemoteDebugSampleType.class));
|
||
|
}
|
||
|
|
||
|
private void write(FriendlyByteBuf p_329925_) {
|
||
|
p_329925_.writeEnum(this.sampleType);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public PacketType<ServerboundDebugSampleSubscriptionPacket> type() {
|
||
|
return GamePacketTypes.SERVERBOUND_DEBUG_SAMPLE_SUBSCRIPTION;
|
||
|
}
|
||
|
|
||
|
public void handle(ServerGamePacketListener p_335058_) {
|
||
|
p_335058_.handleDebugSampleSubscription(this);
|
||
|
}
|
||
|
}
|