minecraft-src/net/minecraft/network/protocol/game/ServerboundPlayerInputPacket.java
2025-07-04 02:00:41 +03:00

25 lines
893 B
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.world.entity.player.Input;
public record ServerboundPlayerInputPacket(Input input) implements Packet<ServerGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundPlayerInputPacket> STREAM_CODEC = StreamCodec.composite(
Input.STREAM_CODEC, ServerboundPlayerInputPacket::input, ServerboundPlayerInputPacket::new
);
@Override
public PacketType<ServerboundPlayerInputPacket> type() {
return GamePacketTypes.SERVERBOUND_PLAYER_INPUT;
}
/**
* Passes this Packet on to the NetHandler for processing.
*/
public void handle(ServerGamePacketListener handler) {
handler.handlePlayerInput(this);
}
}