diff --git a/apps/amethyst/lib/data.ex b/apps/amethyst/lib/data.ex index db3c94c..12fd126 100644 --- a/apps/amethyst/lib/data.ex +++ b/apps/amethyst/lib/data.ex @@ -216,6 +216,11 @@ defmodule Amethyst.Minecraft.Read do {[data | acc], rest, :reversed} end + def byte_array({acc, data, :reversed}) do + {[length], rest} = start(data) |> varint |> stop + raw({acc, rest, :reversed}, length) + end + @doc """ Reads a varint. `read` tracks the number of bytes read and `nacc` tracks the number being read. """