package com.github.steveice10.mc.protocol.packet.ingame.server;

import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.setting.Difficulty;
import com.github.steveice10.mc.protocol.packet.MinecraftPacket;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;

import java.io.IOException;

public class ServerDifficultyPacket extends MinecraftPacket {
    private Difficulty difficulty;

    @SuppressWarnings("unused")
    private ServerDifficultyPacket() {
    }

    public ServerDifficultyPacket(Difficulty difficulty) {
        this.difficulty = difficulty;
    }

    public Difficulty getDifficulty() {
        return this.difficulty;
    }

    @Override
    public void read(NetInput in) throws IOException {
        this.difficulty = MagicValues.key(Difficulty.class, in.readUnsignedByte());
    }

    @Override
    public void write(NetOutput out) throws IOException {
        out.writeByte(MagicValues.value(Integer.class, this.difficulty));
    }
}

@@ -484,16 +484,54 @@
 ficulty;
+%0A    private boolean difficultyLocked;
 %0A%0A    @S
@@ -657,16 +657,42 @@
 fficulty
+, boolean difficultyLocked
 ) %7B%0A    
@@ -803,32 +803,114 @@
 ficulty;%0A    %7D%0A%0A
+    public boolean isDifficultyLocked() %7B%0A        return difficultyLocked;%0A    %7D%0A%0A
     @Override%0A  
@@ -1042,24 +1042,74 @@
 nedByte());%0A
+        this.difficultyLocked = in.readBoolean();%0A
     %7D%0A%0A    @
@@ -1167,32 +1167,32 @@
 s IOException %7B%0A
-
         out.writ
@@ -1245,20 +1245,64 @@
 fficulty));%0A
+        out.writeBoolean(difficultyLocked);%0A
     %7D%0A%7D%0A

Update ServerDifficultyPacket