moved size constant and cleaned the index math
added the missing server bound DisconnectPacket used in MinecraftClient.Disconnect
added check for division by zero
added null check to avoid exceptions