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 ServerboundLockDifficultyPacket implements Packet<ServerGamePacketListener> {
    private boolean locked;
    
    public ServerboundLockDifficultyPacket() {
    }
    
    public ServerboundLockDifficultyPacket(final boolean boolean1) {
        this.locked = boolean1;
    }
    
    @Override
    public void handle(final ServerGamePacketListener qz) {
        qz.handleLockDifficulty(this);
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.locked = mg.readBoolean();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeBoolean(this.locked);
    }
    
    public boolean isLocked() {
        return this.locked;
    }
}
