Compare commits

..

2 Commits

Author SHA1 Message Date
a285e31175
Merge branch 'main' of git.colon-three.com:kodi/amethyst
All checks were successful
Build & Test / nix-build (push) Successful in 1m12s
2024-08-04 07:44:13 +02:00
f5adebb13f
Send brand 2024-08-04 07:44:03 +02:00

View File

@ -266,13 +266,15 @@ defmodule Amethyst.Server.Configuration do
Logger.error("Unhandled but known packet #{elem(tuple, 0)}")
{:unhandled, state}
end
defp handle_plugin_message("minecraft:brand", data, _client, state) do
defp handle_plugin_message("minecraft:brand", data, client, state) do
{[brand], ""} = Read.start(data) |> Read.string |> Read.stop
Logger.info("Client using brand: #{brand}")
transmit({:clientbound_plugin_message, "minecraft:brand", "amethyst"}, client)
{:ok, Keyword.put(state, :brand, brand)}
end
defp handle_plugin_message("amethyst:hello", _data, _client, state) do
defp handle_plugin_message("amethyst:hello", _data, client, state) do
Logger.info("Client is Amethyst aware! Hello!")
transmit({:clientbound_plugin_message, "amethyst:hello", ""}, client)
{:ok, Keyword.put(state, :knows_amethyst, true)}
end
end