package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.Packet;

public class ServerboundClientCommandPacket implements Packet<ServerGamePacketListener> {
    private Action action;
    
    public ServerboundClientCommandPacket() {
    }
    
    public ServerboundClientCommandPacket(final Action a) {
        this.action = a;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.action = mg.<Action>readEnum(Action.class);
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeEnum(this.action);
    }
    
    @Override
    public void handle(final ServerGamePacketListener qz) {
        qz.handleClientCommand(this);
    }
    
    public Action getAction() {
        return this.action;
    }
    
    public enum Action {
        PERFORM_RESPAWN, 
        REQUEST_STATS;
    }
}
