package net.minecraft.network.protocol.game;

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

public class ServerboundJigsawGeneratePacket implements Packet<ServerGamePacketListener> {
    private BlockPos pos;
    private int levels;
    private boolean keepJigsaws;
    
    public ServerboundJigsawGeneratePacket() {
    }
    
    public ServerboundJigsawGeneratePacket(final BlockPos fu, final int integer, final boolean boolean3) {
        this.pos = fu;
        this.levels = integer;
        this.keepJigsaws = boolean3;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.pos = mg.readBlockPos();
        this.levels = mg.readVarInt();
        this.keepJigsaws = mg.readBoolean();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeBlockPos(this.pos);
        mg.writeVarInt(this.levels);
        mg.writeBoolean(this.keepJigsaws);
    }
    
    @Override
    public void handle(final ServerGamePacketListener qz) {
        qz.handleJigsawGenerate(this);
    }
    
    public BlockPos getPos() {
        return this.pos;
    }
    
    public int levels() {
        return this.levels;
    }
    
    public boolean keepJigsaws() {
        return this.keepJigsaws;
    }
}
