package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.network.protocol.Packet;

public class ServerboundPlaceRecipePacket implements Packet<ServerGamePacketListener> {
    private int containerId;
    private ResourceLocation recipe;
    private boolean shiftDown;
    
    public ServerboundPlaceRecipePacket() {
    }
    
    public ServerboundPlaceRecipePacket(final int integer, final Recipe<?> bmu, final boolean boolean3) {
        this.containerId = integer;
        this.recipe = bmu.getId();
        this.shiftDown = boolean3;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.containerId = mg.readByte();
        this.recipe = mg.readResourceLocation();
        this.shiftDown = mg.readBoolean();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeByte(this.containerId);
        mg.writeResourceLocation(this.recipe);
        mg.writeBoolean(this.shiftDown);
    }
    
    @Override
    public void handle(final ServerGamePacketListener qz) {
        qz.handlePlaceRecipe(this);
    }
    
    public int getContainerId() {
        return this.containerId;
    }
    
    public ResourceLocation getRecipe() {
        return this.recipe;
    }
    
    public boolean isShiftDown() {
        return this.shiftDown;
    }
}
