diff --git a/lib/servers/play.ex b/lib/servers/play.ex index 4345389..162d386 100644 --- a/lib/servers/play.ex +++ b/lib/servers/play.ex @@ -31,7 +31,10 @@ defmodule Amethyst.Server.Play do ## DESERIALIZATION @impl true - + def deserialize(0x12, data) do + {[channel], data} = Read.start(data) |> Read.string |> Read.stop + {:serverbound_plugin_message, channel, data} + end def deserialize(type, _) do raise RuntimeError, "Got unknown packet type #{type}!" end @@ -73,6 +76,10 @@ defmodule Amethyst.Server.Play do ## HANDLING @impl true + def handle({:serverbound_plugin_message, channel, data}, _client, state) do + Logger.debug("Got plugin message #{channel} with data #{inspect(data)}") + {:ok, state} + end def handle(tuple, _, state) do Logger.error("Unhandled but known packet #{elem(tuple, 0)}") {:unhandled, state}