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 ServerboundResourcePackPacket implements Packet<ServerGamePacketListener> {
    private Action action;
    
    public ServerboundResourcePackPacket() {
    }
    
    public ServerboundResourcePackPacket(final Action a) {
        this.action = a;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.action = kv.<Action>readEnum(Action.class);
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeEnum(this.action);
    }
    
    @Override
    public void handle(final ServerGamePacketListener pl) {
        pl.handleResourcePackResponse(this);
    }
    
    public enum Action {
        SUCCESSFULLY_LOADED, 
        DECLINED, 
        FAILED_DOWNLOAD, 
        ACCEPTED;
    }
}
