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

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.github.steveice10.mc.protocol.packet.MinecraftPacket;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;

public class ServerUpdateLightPacket extends MinecraftPacket {

    private int chunkX;
    private int chunkZ;
    private int skyLightMask;
    private int blockLightMask;
    private int emptySkyLightMask;
    private int emptyBlockLightMask;
    private List<byte[]> skyLightArrays;
    private List<byte[]> blockLightArrays;

    @Override
    public void read(NetInput in) throws IOException {
        this.chunkX = in.readVarInt();
        this.chunkZ = in.readVarInt();
        this.skyLightMask = in.readVarInt();
        this.blockLightMask = in.readVarInt();
        this.emptySkyLightMask = in.readVarInt();
        this.emptyBlockLightMask = in.readVarInt();
        this.skyLightArrays = new ArrayList<>();
        for (int i = 0; i < 18; i++) {
            if ((this.skyLightMask & 1 << i) != 0) {
                this.skyLightArrays.add(in.readBytes(2048));
            }
        }
        this.blockLightArrays = new ArrayList<>();
        for (int i = 0; i < 18; i++) {
            if ((this.blockLightMask & 1 << i) != 0) {
                this.blockLightArrays.add(in.readBytes(2048));
            }
        }
    }

    @Override
    public void write(NetOutput out) throws IOException {
        out.writeVarInt(this.chunkX);
        out.writeVarInt(this.chunkZ);
        out.writeVarInt(this.skyLightMask);
        out.writeVarInt(this.blockLightMask);
        out.writeVarInt(this.emptySkyLightMask);
        out.writeVarInt(this.emptyBlockLightMask);
        for (byte[] bytes : skyLightArrays) {
            out.writeBytes(bytes);
        }
        for (byte[] bytes : blockLightArrays) {
            out.writeBytes(bytes);
        }
    }
}

@@ -95,59 +95,8 @@
 ion;
-%0Aimport java.util.ArrayList;%0Aimport java.util.List;
 %0A%0Aim
@@ -264,16 +264,35 @@
 utput;%0A%0A
+// TODO: Implement%0A
 public c
@@ -363,1061 +363,321 @@
 ate 
-int chunkX;%0A    private int chunkZ;%0A    private int skyLightMask;%0A    private int blockLightMask;%0A    private int emptySkyLightMask;%0A    private int emptyBlockLightMask;%0A    private List%3Cbyte%5B%5D%3E skyLightArrays;%0A    private List%3Cbyte%5B%5D%3E blockLightArrays;%0A%0A    @Override%0A    public void read(NetInput in) throws IOException %7B%0A        this.chunkX = in.readVarInt();%0A        this.chunkZ = in.readVarInt();%0A        this.skyLightMask = in.readVarInt();%0A        this.blockLightMask = in.readVarInt()
+byte%5B%5D data;%0A%0A    public ServerUpdateLightPacket() %7B%0A    %7D%0A%0A    @Deprecated%0A    public ServerUpdateLightPacket(byte%5B%5D data) %7B%0A        this.data = data
 ;%0A    
+%7D%0A%0A
     
-this.emptySkyLightMask = in.readVarInt();%0A        this.emptyBlockLightMask = in.readVarInt();%0A        this.skyLightArrays = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C 18; i++) %7B%0A            if ((this.skyLightMask & 1 %3C%3C i) != 0) %7B%0A                this.skyLightArrays.add(in.readBytes(2048));%0A            %7D%0A        %7D%0A        this.blockLightArrays = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C 18; i++) %7B%0A            if ((this.blockLightMask & 1 %3C%3C i) != 0) %7B%0A                this.blockLightArrays.add(in.readBytes(2048));%0A            %7D%0A        %7D
+@Deprecated%0A    public byte%5B%5D getData() %7B%0A        return data;%0A    %7D%0A%0A    @Deprecated%0A    public void setData(byte%5B%5D data) %7B%0A        this.data = data;
 %0A   
@@ -714,27 +714,24 @@
 oid 
-write
+read
 (Net
-Out
+In
 put 
-out
+in
 ) th
@@ -761,402 +761,121 @@
     
-out.writeVarInt(this.chunkX);%0A        out.writeVarInt(this.chunkZ);%0A        out.writeVarInt(this.skyLightMask);%0A        out.writeVarInt(this.blockLightMask
+data = in.readBytes(in.available()
 );%0A    
+%7D%0A%0A
     
-out.writeVarInt(this.emptySkyLightMask);%0A        out.writeVarInt(this.emptyBlockLightMask);%0A        for (byte%5B%5D bytes : skyLightArrays) %7B%0A            out.writeBytes(bytes);%0A        %7D%0A        for (byte%5B%5D bytes : blockLightArrays)
+@Override%0A    public void write(NetOutput out) throws IOException
  %7B%0A 
@@ -881,20 +881,16 @@
         
-    
 out.writ
@@ -900,25 +900,14 @@
 tes(
-bytes);%0A        %7D
+data);
 %0A   

Replace LightUpdatePacket Implementation With Dummy