package net.glowstone.net.codec.login;

import com.flowpowered.network.Codec;
import com.flowpowered.network.util.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import java.io.IOException;
import net.glowstone.net.message.login.LoginPluginResponseMessage;

public class LoginPluginResponseCodec implements Codec<LoginPluginResponseMessage> {
    @Override
    public LoginPluginResponseMessage decode(ByteBuf buf) throws IOException {
        int transactionId = ByteBufUtils.readVarInt(buf);
        boolean successful = buf.readBoolean();
        byte[] data = new byte[buf.readableBytes()];
        buf.readBytes(data);

        return new LoginPluginResponseMessage(transactionId, successful, data);
    }

    @Override
    public ByteBuf encode(ByteBuf buf, LoginPluginResponseMessage message) throws IOException {
        ByteBufUtils.writeVarInt(buf, message.getTransactionId());
        buf.writeBoolean(message.isSuccessful());
        buf.writeBytes(message.getData());

        return buf;
    }
}

@@ -132,126 +132,127 @@
 ort 
-io.netty.buffer.ByteBuf;%0Aimport java.io.IOException;%0Aimport net.glowstone.net.message.login.LoginPluginResponseMessage
+net.glowstone.net.message.login.LoginPluginResponseMessage;%0Aimport io.netty.buffer.ByteBuf;%0A%0Aimport java.io.IOException
 ;%0A%0Ap

fix import order